One Hundred Hellos - Blog

convert flac to mp3 - 16 June 2007

This is the gem that I found:
flac -d -o - "$filename" | lame -b 320 -h - > "${filename:0:${#filename}-5}".mp3

So using this trick for filenames with spaces: (while read does not break on spaces as for does !)

find -type f -name \*flac | while read f; do
echo "-=-= $f =-=-";
flac -d -o - "$f" | lame -b 320 -h - > "${f:0:${#f}-5}".mp3
done

Don't thimk this will do id3 tags though....Music Brainz...And done