Do you need a GUI to be able to create and burn your favorite music tracks on a standard audio CD which then can be used by any CD player? The answer is no ! GUI is for losers ! Right? :-) Let's see how hard it is to burn an audio CD with a cdrecord linux command. What is needed:
- CD burner - audio files in mp3, ogg, acc or wav format
- cdrecord
- ffmpeg
- normalize-audio
Install all prerequisites:
# apt-get install cdrecord ffmpeg normalize-audio libavcodec52
In our scenario we have a selection of MP3 and OGG files from different albums stored in a single directory called burn:
ls ~/burn/ 03.Come As You Are.mp3 07 - Crystal Mountain.mp3 09-We Who Are Not as Others.mp3 Lemuria_-_05_-_Lemuria.ogg
Since all files are taken from a different locations / albums the chance that they all have a different volume settings is very high. To make them volume uniform we use a normalize-audio command. Normalize normally works only on wav files so first we need to convert all files to wav.
NOTE: if names of your files contain a space use this command to replace space with _:
$ for f in *; do mv "$f" `echo $f | tr ' ' '_'`; done
Convert all files to wav format:
$ for i in $( ls ); do ffmpeg -i $i $i.wav; done
The following step can be omitted but it is recommend to normalize-audio all files to equalize sound volumes:
NOTE:use normalize-mp3 ornormalize-ogg to normalize non-wav audio files
$ normalize-audio -m *.wav
OUTPUT:
Computing levels... Lemuria_-_05_-_Le 100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00) Applying adjustment of 4.15dB to 03.Come_As_You_Are.mp3.wav... 03.Come_As_You_Ar 100% done, ETA 00:00:00 (batch 22% done, ETA 00:00:00) Applying adjustment of -0.91dB to 07_-_Crystal_Mountain.mp3.wav... 07_-_Crystal_Moun 100% done, ETA 00:00:00 (batch 52% done, ETA 00:00:01) Applying adjustment of -0.82dB to 09-We_Who_Are_Not_as_Others.mp3.wav... 09-We_Who_Are_Not 100% done, ETA 00:00:00 (batch 75% done, ETA 00:00:01) Applying adjustment of -1.37dB to Lemuria_-_05_-_Lemuria.ogg.wav... Lemuria_-_05_-_Le 100% done, ETA 00:00:00 (batch 100% done, ETA 00:00:00)
We are almost there. In the next step we need to identify our CD/DVD burner block device file name:
$ wodim --devices
OUTPUT:
wodim: Overview of accessible drives (1 found) : ------------------------------------------------------------------------- 0 dev='/dev/scd0' rwrw-- : 'TSSTcorp' 'CD/DVDW SH-S183L' -------------------------------------------------------------------------
take a note of the block device file path. Which in this case is /dev/scd0. As a final step we can burn all audio wav files with cdrecord.
$ cdrecord -v -nofix -eject dev='/dev/scd0' -audio -pad *.wav
All done. Your music CD is ready to use. Please not that -nofix cdrecord's option will instruct a cdrecord to not to close a CD disk session, which allows us to put more tracks on the disc if required. If you wish to close a CD session you can do it with a following linux command:
$ cdrecord -v -fix -eject dev='/dev/scd0'