Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple binfiles, overhaul parameter handling, split WAV files #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,19 @@
Clarify manual page for input/output file types
Improvement from Reuben Thomas, debian bug: #503151

1.2.3 - Jun 30 2022 - twojstaryzdomu

Added support for track # and multiple bin FILEs in cue sheet.
The output files are now named after the FILE with the appropriate
output extension added, without a track # inserted in between the
basename and the extension. The -t option includes the track # in
the output filenames as done by default in earlier releases.

Sealed various memory leaks. Refactored exit statements.

Abort further processing if output file already exists.

Added support for ## as track # replacement token in the basename
parameter.

Added support for splitting WAV files into individual tracks.
36 changes: 25 additions & 11 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

binchunker for Unix, version 1.2.2
binchunker for Unix, version 1.2.3
Copyright (C) 1998-2004 Heikki Hannikainen <[email protected]>

Enhancements provided by:
Expand All @@ -9,6 +9,7 @@
Piotr Kaczuba <[email protected]>, 2009
Reuben Thomas <[email protected]>, 2008
Yegor Timoshenko <[email protected]>, 2017
twojstaryzdomu <@github.com>, 2022


http://he.fi/bchunk/
Expand Down Expand Up @@ -61,6 +62,9 @@
binchunker converts a CD image in a ".bin / .cue" format
(sometimes ".raw / .cue") to a set of .iso and .cdr tracks.

It also allows to split uncompressed PCM audio files in the
WAV format into individual tracks.

The bin/cue format is used by some non-Unix cd-writing
software, but is not supported on most other cd-writing
programs.
Expand All @@ -85,8 +89,8 @@

How to install this stuff:

$ gzip -d -c bchunk-1.2.2.tar.gz | tar xvf -
$ cd bchunk-1.2.2
$ gzip -d -c bchunk-1.2.3.tar.gz | tar xvf -
$ cd bchunk-1.2.3
$ make
# make install

Expand Down Expand Up @@ -116,13 +120,23 @@

How to use this stuff:

bchunk [-v] [-p (PSX)] [-r (raw)] [-w (wav)] [-s (swabaudio)]
<image.bin> <image.cue> <basename>

image.bin is the raw cd image file. image.cue is the
track index file containing track types and offsets.
basename is used for the beginning part of the created
track files.
bchunk [-t] [-v] [-p (PSX)] [-r (raw)] [-w (wav)] [-s (swabaudio)]
<image.bin | image.wav | track # | '*'> <image.cue> [ <basename> ]

image.bin is a source raw cd image file and image.wav is an
uncompressed PCM audio file, either listed in the
cue sheet file as a FILE. track # identifies the track listed
in the cue sheet as a TRACK. The wildcard '*' (quoted)
selects all tracks for conversion. image.cue is the cue sheet
file containing filenames, track types and offsets. The optional
basename is used for the leading part of the output filenames.
By default, the output files are now named after the basename
of the source image file or the track #, ending with the
appropriate format extension. basename may contain the track
token ## which will be replaced by the track number.

The -t flag adds the track # in the output filename between
the basename & the extension, as in versions prior to 1.2.3.

The -v flag makes binchunker print some more unnecessary
messages, which should not be of interest for anyone.
Expand All @@ -137,7 +151,7 @@
The -p and -r flags works only with MODE2/2352 input (if input
is in PSX mode pass -p flag or if it is in raw format pass
-r flag).

The -w flag makes binchunker write audio tracks in WAV format.

The -s flag makes binchunker swap byte order in the samples of
Expand Down
39 changes: 31 additions & 8 deletions bchunk.1
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.TH BCHUNK 1 "v1.2.2 14 Nov 2017" "Heikki Hannikainen"
.TH BCHUNK 1 "v1.2.3 30 Jun 2022" "Heikki Hannikainen"
.SH NAME
bchunk \- CD image format conversion from bin/cue to iso/cdr
and WAV file splitter
.SH SYNOPSIS
.B bchunk [-v] [-p] [-r] [-w] [-s] <image.bin> <image.cue> <basename>
.B bchunk [-t] [-v] [-p] [-r] [-w] [-s]
<image.bin | image.wav | track # | '*'> <image.cue> [ <basename> ]
.SH DESCRIPTION
.LP
.B bchunk
Expand All @@ -13,10 +15,19 @@ The bin/cue format is used by some non-Unix cd-writing
software, but is not supported on most other cd-writing
programs.
.LP
image.bin is the raw cd image file. image.cue is the
track index file containing track types and offsets.
basename is used for the beginning part of the created
track files.
It also allows to split uncompressed PCM audio files in the
WAV format into individual tracks.
.LP
\fIimage.bin\fP is a raw cd image file and \fIimage.wav\fP is an
uncompressed PCM audio file, either listed in the cue sheet file
as a FILE. \fItrack #\fP is the track number listed in the cue sheet
as a TRACK. \fItrack #\fP may omit the leading 0s. The wildcard
'\fI*\fP' (single quoted to prevent shell expansion) selects all
tracks from a cue sheet for conversion. \fIimage.cue\fP is the cue
sheet file containing track types and offsets. \fIbasename\fP is
optionally used for the leading part of output filenames.
\fIbasename\fP may contain the track token '##' which will be
replaced by the track number.
.LP
The produced .iso track contains an ISO file system, which can be
mounted through a loop device on Linux systems, or
Expand All @@ -38,6 +49,12 @@ The format itself does not contain this feature and in an ambiguous
case it can only guess.
.SH OPTIONS
.TP 10
.BI \-t
Adds the track # in the output filename between the basename &
the extension, as in
.B bchunk
releases prior to 1.2.3.
.TP 10
.BI \-v
Makes binchunker print some more unnecessary messages, which should
not be of interest for anyone.
Expand All @@ -61,10 +78,14 @@ raw format.
.LP
.TP 5
.B image.bin
Raw CD image file
Raw CD image file, listed in the cue sheet as a FILE.
.TP 5
.B image.wav
WAV file with uncompressed PCM audio, listed in the cue sheet
as a FILE.
.TP 5
.B image.cue
TOC (Track index, Table Of Contents) file
Cue sheet, TOC (Track index, Table Of Contents) file.
.TP 5
.B *.iso
Tracks in ISO9660 CD filesystem format. Can be either written on a
Expand Down Expand Up @@ -95,3 +116,5 @@ Godmar Back <[email protected]>
.br
Matthew Green <[email protected]>
.br
twojstaryzdomu <@github.com>
.br
Loading