#!/bin/bash # # Chess Griffin # # # Version History # # 0.1 2005-09-10 # 0.2 2006-02-25 # 0.3 2006-03-27 # # Encode a .wav file into a .mp3 and .ogg # based upon various settings and also # populate the ID3 tags # # Listen to the river sing sweet songs to rock my soul # # BEGIN CONFIG # # insert the input filename of the .wav # (e.g. filename.wav) INPUTFILE=myinput.wav # insert the output filename without the .ogg or .mp3 extension # (e.g. filename) OUTPUTFILE=myoutput # put the resample rate here in Hz # (e.g. 22050) RESAMPLE=22050 # put the bitrate here # (e.g. 48) BITRATE=48 # ID3 Tag Variables COMMENT="This is a Comment Tag" DATE="2006" TITLE="This is a Title Tag" ALBUM="This is an Album Tag" ARTIST="John Smith" GENRE="Other" # END CONFIG # Do the Ogg encoding first oggenc -o $OUTPUTFILE.ogg --resample $RESAMPLE -b $BITRATE -d "$DATE" -t "$TITLE" -l "$ALBUM" -a "$ARTIST" -G "$GENRE" -c "COMMENT=$COMMENT" $INPUTFILE # Do the MP3 encoding next lame --resample $RESAMPLE/1000 -b $BITRATE --add-id3v2 --ty "$DATE" --tt "$TITLE" --tl "$ALBUM" --ta "$ARTIST" --tg $GENRE --tc "$COMMENT" $INPUTFILE $OUTPUTFILE.mp3 echo "done"