Wednesday 21 March 2012

Audio Encoding Formats - MP3, OGG, FLAC?

No doubt, mp3 has been the most popular audio format for passing around audio files for years. I've used this format at substance.org.lv, usually, at 160-192 kbit/s for mixes and 256 kbit/s for tracks.

Recently, however, I've started to think about other alternatives.
As a child I used to listen to some of the records from my father's collection, among them there were couple of Mike Oldfield's albums. Last summer I downloaded them to have some nostalgic moments and was sort of 'blown away' by the crisp, clear sound they had. They were flac.

Not that I hadn't hear about this format before, but this time I started digging around and learned how to actually use the encoder. GUI tool didn't work for some reason, but the command-line utility was pretty straight-forward. And I like command-line :). So, I started encoding my mixes for personal use using flac.

Flac files are about half the size of original wav, so it is not very well suited for sharing on the Internet. So I focused on another mp3 alternative, that has also been around for a while, but failed to really get my attention before - Ogg Vorbis.

It turned out that my "WaveLab Elements" software supports ogg encoding out-of-box. It is important to note, that when you attempt to use it's mp3 encoder - they immediately try to suck money out of you :O

There might be some concerns about whether flac and ogg are supported widely enough. I tested this at home and I tested this on my work's laptop (Ubuntu) - no problem, there were no special installations required, both were supported right away.

Next thing to do is to determine which quality setting works best. How small can the file get and still sound awesome? For flac it doesn't matter much, as the codec is lossless and different settings only affect CPU usage / file size ratio, but you don't worry much about file size, when you're using it, right? After minimal testing I found that default settings are reasonable and should work well for me.

For ogg, quick Google search tells, that supposedly quality 5 (at about 160 kbit/s) is pretty good and quality 6 (~192 kbit/s) is practically indistinguishable from wav.

I used small loop from Reeko's track for testing, because it has rich and interesting treble soundscape. It was cut from a recorded vinyl mix and has undergone some processing, since my goal here is to find best fit for real-life application, not for some abstract uber-quality case.
Here are some sample files:
test_loop.wav 
test_loop_vbr_0.ogg 
test_loop_cbr160.ogg 
test_loop_cbr192.mp3 
test_loop_cbr192.ogg 
test_loop_cbr256.mp3 
test_loop_cbr256.ogg 

As expected, at smallest quality, ogg file is extremely small, but sound is not messed up as it would be using mp3. For the last five samples, I must admit, there is barely any noticeable difference. I think, I do hear that cbr160.ogg has a tiny-bit less stereo-wideness, but it might as well be a placebo effect :) I definitely wouldn't be able to tell which is which, when presented with only one of the specimens.

My take on this is - why contribute to the popularity of the patent protected mp3, when there are newer and better performing open formats out there? It appears that from now on I'll use ogg at about 192 kbit/sec for mixes and flac with the default settings for tracks.

Hail to the technology, hail to the open source!

UPDATE: There has been a complaint that Windows Media Player doesn't understand ogg. Google says that you need to install so called DirectShow Filters codec pack.

No comments:

Post a Comment