Tuesday, 22 February 2011

flac to mp3

for file in *.flac; do flac -cd "$file" | lame -h - "${file%.flac}.mp3"; done

UPDATE

I used, `-h' above. Different conversion is possible with,

for file in *.flac; do flac -cd "$file" | lame --noreplaygain -q 0 --vbr-new - "${file%.flac}.mp3"; done

vbr: automatically choose bit rate to achieve a `quality': 4 is default (0 being highest,
9 being lowest).
Turn off level adjustment for each track. I can hear clipping, thank you, and will turn the level down if required.
-q 0 : highest quality encoding.