#!/bin/sh ################################################################################ # # mp3tocdr # # This script takes a list of MP3 files on the command line and burns # them as CDDA tracks onto a CD. The resulting CD can be played in # virtually any standard audio CD player. # # There is some setup required. In particular, you must install the # following programs first: # # mpg123-0.59r http://mpg.123.org/ # sox-12.16 http://home.sprynet.com/~cbagwell/sox.html # cdrecord-1.8 http://www.fokus.gmd.de/nthp/employees/schilling/cdrecord.html # ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/cdrecord.tar.gz # # You also must setup your /etc/cdrecord.conf. For my Yamaha CRW4416S # which is set to use SCSI ID 2, have the following settings: # # CDR_DEVICE=yamaha # CDR_SPEED=4 # CDR_FIFOSIZE=8m # yamaha= 0,2,0 -1 -1 # # Generally, the script must be run as root because only root has permission # to run cdrecord on most systems. Use a sequence like this to create an # Audio CD from a collection of MP3 files: # # # mp3tocdr 04-you_wreck_me.mp3 08-dont_fade_on_me.mp3 # # mp3tocdr 07-banjo_rapsody.mp3 09-under_my_skin.mp3 08-south.mp3 # # mp3tocdr 07-jj.mp3 02-easy_street.mp3 13-vincent.mp3 # ... # # cdrecord -v -fix -eject # # Author: David C. Snyder - 3/29/2000 ################################################################################ mp3_list=`echo $* | fmt -1 | grep '\.mp3$'` # filter out non-mp3 files for i in $mp3_list do echo "$i -> CD" mpg123 -s $i \ | sox -c2 -s -w -t raw -r 44100 - -t cdr - \ | cdrecord -v -audio -nofix - echo "" done echo "\n- Don't forget to run cdrecord -fix after you record the last track."