I know there are lots of tools out there that automatically create BIN/CUE files - but most of them only by ripping the CD.
But I wanted to create an exact digital master, generated out of the original WAV files.
It's not that difficult, because a BIN file is a plain PCM encoded audio stream with the following parameters:
- PCM encoding
- 44100 Hz
- 16 bits
- 2 channels
- little endian
The CUE sheet is a simple textfile.
Creating the BIN
For audio conversion, I've used SoX (the Swiss Army knife of sound processing programs).
Creating silence...
Usually, you have a pause between your tracks. The default duration is 2 seconds. CD burning applications create a silence-audio with that duration for you, but we have to do it manually.
sox -t raw -c 2 -s $ENDIAN -2 -r 44100 /dev/zero $SILENCE trim 0 $DURATION
Converting the WAVs bin raw PCM
for WAV in $SOURCE; do
FILENAME=`basename $WAV`
echo "File: $FILENAME"
sox $WAV -s -2 $ENDIAN -2 -r 44100 $FILENAME.raw
done
Putting it all together
Now we just have to 'glue' the audio files with silence in between together. Since raw PCM has no header, and 'cat' is byte-safe, we can simply copy it into the final BIN:
for RAW in $SOURCE; do
FILENAME=`basename $RAW`
echo "RAW file: $FILENAME"
cat $RAW >> $BIN
cat $SILENCE >> $BIN
done
Creating the CUE
As I've already said, the CUE sheet is a plain textfile. There are no real, official specifications, but there's good documentation at digitalx.org.
IMPORTANT:
I've used cdrdao for verifying the resulting BIN/CUE combination.
- I've ripped other audio CDs to get reference BIN/CUE examples.
- I've burned my generated BIN/CUE with cdrdao
For some reason, cdrdao reads/writes BIN images in big endian. The CD burning tool at our production facility however, expected little endian!
So you might want to clear with your production facility if they expect little or big endian!