Converting FLAC to 320kbps MP3 with Foobar

foobar2000

Lossless codecs, like FLAC, are great when it comes to preserving all the quality present on the original media. Unfortunately though, they do take up quite a bit of space and most lossless codecs are far from popular in the mainstream. Therefore, it often becomes necessary to sacrifice some of the quality in order to recoup some disk space and increase compatibility — because the day that the iPod supports open source codecs, is also likely to be the day that hell freezes over…

So, you’re stuck with hordes of FLAC files and you want to convert them all into high-quality MP3’s, and, of course, you’d like to do all this without paying a penny, correct? Is that even possible? After all, the Fraunhofer Society currently owns the rights to the MP3 codec, and they’re not shy about cashing in on it.

Fortunately, there is a solution, and both of the tools needed for this operation are available for free!

Ever since I gave up on iTunes and Winamp, I’ve been using a very light-weight and very elegant music player known as Foobar2000, or just Foobar for short. Besides the wonderful job it does playing back music with an absolute minimum of fuss, unlike iTunes, it also features an extensive array of useful plug-ins, the most fundamental of which come pre-installed. One of these built-in tools is the codec converter, which is what we’ll be using to solve our little dilemma.

In order to encode and decode MP3 files, Foobar uses the LAME codec. Due to reasons I don’t fully understand, the guys behind this codec have somehow circumvented the need to license the relevant technology from the Fraunhofer Society, and can therefore offer MP3 support for free — sounds like that might be an interesting article all on its own, but I digress.

Anyway without further ado, here’s the interesting bit:

Once you have Foobar installed and fired up, click on the “Library” menu, and select “Configure” — alternatively, you can just hit Ctrl-P, and that will get you to the same place. On the left side of the “Preferences” window that just opened up expand the entry titled “Tools,” and click on “Converter.”

foobar-pref

From here, look to the right side of this window, and you should see a button labeled “Add New.” Click on that.

You should now see the window pictured below. From the “Encoder” list, select “Custom.” The first text box under the drop-down that you just used should now read “lame.exe” –  again, just like in the picture.

foobar-pref-ii

The settings are almost perfect right from the start. There is, however, one problem. We would like to convert our pristine FLAC files to the highest quality offered for MP3’s, but unfortunately, that’s not what the settings reflect at the moment. In order to rectify this, all that we need to do is replace the text in the “Parameters” box with the following:

-S --noreplaygain -b 320 - %d

From a technical standpoint, that’s all you need to change; your files will now be properly converted to 320kbps MP3’s. The description of this conversion preset, however, won’t reflect the fact that we’ve forced the LAME encoder to use a constant bit rate of 320kbps. But, this is easily fixed as well. At the very bottom of the window, simply update the “Bitrate” field to 320, and set the “Settings” field to “CBR,” short for “Constant Bit Rate.”

That’s it, you’re now ready to convert your FLAC files.

Now, in case you’re new to Foobar, once you’re ready to actually convert a file, all you need to do is add the FLAC files in question to any playlist, select the song, right-click, and hit “Convert.” The rest is really straight forward…

Oh, almost forgot: The first time that you convert something to MP3, Foobar will ask you where it can find the LAME executable (i.e.: the file called LAME.exe). If you don’t already have it, you can download it from www.free-codecs.com. Once you’ve downloaded it, simply extract it to any location of your choosing — perhaps you might want to extract it your music folder, so you know where it is for future reference. After the extraction, head back over to Foobar, and when prompted, simply select the executable from the folder that you extracted the .zip file into.

Enjoy!