Audio Codecs

I am not sure how many of you are already aware of it, but codecs are things that you deal with when playing any digital media. Whenever there’s a video or audio file you can’t seem to open, chances are, that is a codec issue. I think it’s high time that you understand that problem rather than blindly follow some techie-dude’s advice to just install VLC player and hope it solves the problem for you.

Codec is short for coder-decoder. It is an algorithm (or process), that compresses data in a specific manner. This is important because, as you may already know, compression significantly decreases file sizes.

Uncompressed audio takes up a lot of storage space. This has implications on both offline/local and online media. Compression is what allows a thousand songs to be burned in a standard CD-R rather than just 10 or so in a standard audio compact disc. It also keeps streaming and downloading digital audio a realistic prospect even for bandwidth-starved connections.

However, you can’t just play a compressed file directly. You will also need the codec used for compression to decompress or “translate” that same file in order for it to be opened by your media player.

To put it as simply as I can… a codec acts very much the same way as an archiving tool like WinZip.

However, not all codecs are made equal. There are two general groups to consider. First is the lossy compression format, where there is a tradeoff between size and quality. The second is the lossless format, which obviously attempts not to compromise quality.

There are so many codecs being used today and it will be impossible to cover them all in any meaningful way. So for the purpose of this course, we will focus only on the common audio codecs. I am personally not qualified to discuss the technical aspects of these formats too deeply, but we can deal with that later if you like and if we have the time.
1. MPEG-1/MPEG-2 Audio Layer III (MP3)

The MP3 format is arguably the most popular of them all. It is the JPEG of audio, not just in terms of ubiquity, but also because it is a lossy format. Just like JPEGs, you can really squeeze digital audio into a small file, but at the cost of fidelity. The most important parameter in balancing quality and size is the bitrate. When I started listening to MP3 files back in the mid-late 1990’s, 128kbps seemed to be the de facto standard — the so-called near-CD quality. But as time went by, storage became larger and cheaper, while Internet connections got faster. This afforded the more pervasive use of higher bitrate MP3’s. The format maxes out at 320kbps and today, you will encounter many files that read as such. You may also want to consider mixing down your own audio files at that level.

In an attempt in additional optimization, you will encounter the terms constant bitrate (CBR) and variable bitrate (VBR). The bitrate remains the same all throughout a file with CBR. But as the MP3 codec matured, we were given the option of encoding an audio file whose bitrate changes across the waveform, depending on the level of detail at each point in time. If you’re using Winamp, you will see that kbps meter continuously changing when playing an MP3 with VBR. So let us say that you want to encode at 320kbps, when in VBR mode, that is the maximum bitrate the encoder will go, which it reserves for parts of the file where it thinks it is necessary, and then encode at lower bitrateseverywhere else. This in theory results in an even smaller file without any noticeable compromise in quality compared to its CBR version.
2. Windows Media Audio (WMA)

This is actually a set of proprietary codecs developed by or under Microsoft. This set includes the actual WMA, the WMA Pro which reaches 768kbps, and the WMA Lossless, which is, as you may have guessed, a lossless compression format. Microsoft of course will claim superiority over the MP3 format. That remains heavily disputed, though.
3. MPEG-1 Advanced Audio Coding (AAC)

This format was intended to be the successor of the MP3, with its increased flexibility. The succession seems like it hasn’t really happened yet. But chances are, if a player can read MP3 files, it can also read AAC files. You will also see this format natively supported in many devices, notably in Apple and Sony products.
4. RealAudio

People who have been prowling the WWW since the 1990’s would know how RealMedia dominated streaming media. While it is practically a dead format, you may still encounter it from time to time.
5. Free Lossless Audio Codec (FLAC)

FLAC is an open format. And it has already gained wide acceptance. It can reduce audio files to 50-60% of its original uncompressed size without compromising quality. It was difficult to adopt this format at the beginning, of course. But that has gradually changed, now that metadata can now be embedded on it, and operating systems have started to support it natively. Presently, FLAC is the most widely supported lossless format in the market.