goal: directory of .ogg files, convert to .mp3
I couldn't figure out how to loop through the files with spaces, so I replaced with _ and my sox isn't compiled with encode mp3, so i convert to wav then to mp3.. is there a better way to go about this? what i have works, but its not standard at best (as if i know what standard is), and at worst... well i'm daft
For the sake of learning something and seeing a good example of a better way to do this, can someone improve on this? thanks I'm converting public domain audio books to play on my archos, if that matters
Code:
find . -name '* *' | while read file;
do
target=`echo "$file" | sed 's/ /_/g'`;
mv "$file" "$target";
sox $target $target.wav
rm $target
lame $target.wav $target.mp3
rm $target.wav
done;