2 # Demo script for processing all audio tracks with a mp3 encoder
3 # This variant creates temporary wav files. There is another
4 # variant of this script (cdda2mp3), which uses a named pipe
5 # instead. This variant needs more disk space than the other one.
7 # usage: cdda2mp3.new <name prefix for all mp3 files>
9 # list_audio_tracks is a (symbolic) link to cdda2wav
10 # and used to generate a list of audio track numbers and start
11 # sectors, which in turn are used in a loop to spawn cdda2wav
12 # and the post processor on a track by track basis.
15 # feedback needed!!!!!!!!!!!!!!!!!
18 # specify the audio track listing program and its options
22 # specify the sampling program and its options
23 # do not specify the track option here!
25 CDDA2WAV_OPTS='-Owav -H -P0 -q'
27 # for normal use, comment out the next line with a #
30 # specify the post processing program and its options
32 #MP_OPTIONS='2>/dev/null 1>/dev/null'
33 MP_OPTIONS='-br 128000'
38 FILEPREFIX=${1:-audiotrack}
40 # clean up wav file on exit, abort, ...
41 trap "rm -rf $WAVFILE" 0 2 3 4 6 7 8 10 11 12 13 15
43 # feed track numbers and start sectors into loop
44 $LAT $LAT_OPTIONS | while read TRACK STARTSECTOR;
46 $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG $WAVFILE
47 # echo n | $MP_CODER $WAVFILE $FILEPREFIX$TRACK.mp3 $MP_OPTIONS
48 $MP_CODER $WAVFILE $FILEPREFIX$TRACK.mp3 $MP_OPTIONS
52 if [ $RES = 0 ] ; then
53 echo File $FILEPREFIX$TRACK.mp3 finished successfully.
56 echo File $FILEPREFIX$TRACK.mp3 failed \(result $RES\). Aborted. >&2