Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go


Audio CD From Collection of MP3s

We can use cdrdao to create an audio CD from a colleciton of mp3 files. On Mint (36.53) this is the way to do it since cdrecord fails. The only complication is the need for a table of contents file, but it is easy to produce. There are issues to do with gaps but this can safely be ignored. Either wav or cdr files can be written by cdrdao to a CD-R disk.

Put the following into /usr/local/bin/mkcdrtoc:

  for i in *.mp3; do
    if [ ! -e ${i%mp3}cdr ]; then
      mpg123 --cdr - $i > ${i%mp3}cdr;
  printf "CD_DA\n" > disk.toc
  for i in *.cdr; do
    printf "TRACK AUDIO\nFILE \"$i\" 0\n" >> disk.toc
  printf "\n========== disk.toc ==================\n"
  cat disk.toc
  printf "========================================\n"
  printf "\n>>>>>>>> Now run \"cdrdao write disk.toc\" <<<<<<<<<<\n"

Then the following two steps will convert all mp3 files in the current directory to cdr, then burn them to a CD-R or CD-RW. If you want to change the order of the tracks, simply edit disk.toc.

  $ mkcdrtoc
  $ cdrdao write disk.toc

We can alternatively use cdrecord:

  $ for i in *.mp3; do mpg123 --cdr - $i > ${i%mp3}cdr; done
  $ cdrecord -v dev=0,1,0 -audio -pad *.cdr

Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. Creative Commons ShareAlike V4.