#!/bin/bash #convert a mp3 to 44100 samplerate and 128 bitrate LIST=$(ls *.mp3) for i in $LIST; do ORIG=$i DEST=$i.wav DEST2=$i.wav.wav #lame --decode -v 1_07ChristsInTheManger.mp3 lame --decode -v $ORIG echo "done converting $i to wav $DEST" echo "Removing Original" rm $ORIG echo "Resampling to 44100 format" #resample -to 44100 1_07ChristsInTheManger.mp3.wav 1_07ChristsInTheManger.mp3.wav.wav resample -to 44100 $DEST $DEST2 echo "Converting back to mp3 file" #lame -b 128 44100 Christ_In_The_Manger.wav 1_07ChristsInTheManger.mp3 lame -b 128 $DEST2 $ORIG echo "Clean up" rm $DEST rm $DEST2 done