Transcodemp3

From TWUUG

#!/bin/bash
# Transcode, copy, and adjust volume of mp3 files for use with
# a small, mono, music-on-hold player.  By Mark A. Davis, 2007
#
echo "Warning!  About to alter all mp3s in your entire filetree"
echo "from this directory and below!..."
sleep 4
#
for FILE in `find . -iname "*mp3"`
 do echo "Starting with "$FILE
 # The key with lame is the -V8.  The lower the number, the higher the
 # quality.  8 is as low as you want to ever go.  5 is much better
 # -m m -a  is to convert to mono for our music-on-hold system use
 lame --noreplaygain --nohist -q 2 -m m -a -V8 "$FILE" "$FILE".hold
 # lame will lose ID3 tags when transcoding, use "id3" to copy back
 id3 -D "$FILE" "$FILE".hold
 # mp3gain will magically alter the volume to seem to be the same for
 # all files
 mp3gain -r -c "$FILE".hold
 mv "$FILE".hold "$FILE"
 echo "Done with "$FILE
done

Personal tools