Tue Nov 8 10:58:41 GMT 2011

CD burning in Linux

this is a shortened version of http://www.gentoo-wiki.info/HOWTO_Create_an_Audio_CD.

shift your mp3 files (or whatever format your music is in) to a directory and cd there.

Remove any spaces from the filenames:
for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`; done
Convert all the files to .wav format:
for i in *; do ffmpeg -i "$i" -acodec pcm_s16le -ar 44100 -ac 2 -f wav "$i.wav"; done
or
for i in *.mp3; do mpg321 -w "`basename "$i" .mp3`.wav" "$i"; done
make sure all the files are compliant:
file *.wav | grep -v 44100
(should have no output)
Normalize the music if from differing sources:
normalize -m *.wav
then burn the music to disc:
cdrecord -scanbus 
- to find out your CD virtual SCSI path (something like 1,0,0)
cdrecord -v dev=1,0,0 -audio -pad *.wav
or the quick and dirty bash script:
#!/bin/bash
for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`; done
for i in *.mp3; do lame --decode "$i" "`basename "$i" .mp3`.wav"; done
normalize *.wav
echo CD_DA > cd
for x in *.wav; do echo "
TRACK AUDIO
AUDIOFILE \"$x\" 0" >> cd
cdrdao write --device ATA:0,0,0 cd; done;
-----

Posted by Phill | Permalink