Solution: Converting flac to mp3

Filed under
HowTos

Sometimes you need to convert a load of flac files to mp3's, for example when wanting to listen them on your mp3 player. This solution contains a single line of bash that'll convert all flac files in the current directory to mp3's, keeping the flac files.

Note that you will need flac and lame for this to work. Run the following line in the directory where the flac files are:

[rechosen@localhost ~]$ for file in *.flac; do $(flac -cd "$file" | lame -h - "${file%.flac}.mp3"); done

This will output the mp3 files in the same directory as the flac files. If any of the mp3 files that's being created already exists, it will be overwritten. When the conversion has finished, you can copy the mp3 files to an other location like this:

Full Story.