Burning gapless audio CDs in Linux
Burning gapless audio CDs from the Linux command-line is easy.
Let’s say you have a directory full of .FLAC files. Then all you’ll need to do is:
- convert the files to CD audio format
- create a description file
- burn the CD
- test it
The following paste-worthy lines are all you need.
find *.flac -exec sox {} `basename {} .flac`.cdda \; for file in *.cdda; do echo "TRACK AUDIO" >> toc; echo "FILE \"$file\" 0" >> toc; done cdrdao write toc mplayer cdda://1
You’ll have to change “.flac” to “.mp3” if you’re burning a directory of MP3s. You might also have to pass the –device option to cdrdao. The rest should not need to be changed.
UPDATE: A reader has written in to say that the FLAC->CDDA conversion can be speeded up like this:
find . -type f -name *.flac | parallel sox {} {.}.cdda