Audio encoding formats have been given some extra press in the Mac community recently. One of the most significant features of iTunes Match, announced at WWDC 2011, is that users will have access to 256-kbps AAC versions of the songs in their libraries, even if the original files were encoded at a lower bit rate or in a different format. Later, on 5by5, John Siracusa winkingly suggested that an e-mail from him to Steve Jobs was the impetus for Apple’s introduction of their Apple Lossless codec, and Marco Arment mentioned his own foray into lossless codec design.

One of the questions raised during the latter show is why anyone would even use a lossless audio codec. I think most lossless users are audiophiles: people who can tell the difference between lossless and lossy formats, or at least pretend to. I’m not an audiophile, but I do encode my music as Apple Lossless,1 because the choice of a lossy format is arbitrary. The lossless version, on the other hand, is canonical.

Since lossless encoding retains all of the original data, it’s effectively equivalent to the original CD data. It’s compressed to save disk space, but the audio data is, sample for sample, identical to the source from which it was ripped. (In this sense, all lossless codecs are equivalent to each other: I could rip a CD track as FLAC, WAV, and Apple Lossless, but the actual audio data is the same in each case.) Once you decide to encode your music losslessly, you need only choose the particular format that will work best with your music-playing software and hardware; there are no more decisions to be made. Your music is encoded in the highest possible quality, because it is the original music.

Lossy encoding is trickier. You must choose not only a format, but now a bit rate too.2 As before, the choice of format is mostly dictated by the software and hardware you want to use, but the bit rate is up to you. You are presented with a tradeoff: a higher bit rate gives an audio file that sounds more like the original, but uses more space on disk; a file with a lower bit rate takes up less space but may sound flat or tinny.

As technology progresses we are able to make audio at a given bit rate sound better and better through smarter encoding. An MP3 file that was encoded at 96 kbps by an older MP3 encoder might sound the same as a file that uses only 64 kbps today. 128-kbps MP3 was the de facto standard during the Napster days for its software support, acceptable quality, and small size, but 256-kbps AAC is now widespread thanks to its use in the iTunes Store.

My problem with lossy encoding is that the choice of bit rate is fairly arbitrary. People’s choice of bit rate is strongly influenced by what others consider “good enough” and by what music companies are selling. It represents a compromise of quality for storage space, but storage is continually becoming cheaper. Suppose you decide one day that 192-kbps Vorbis audio is the best use of your hard drive space; what happens a year later when 256-kbps AAC makes more sense for you? With lossy codecs, as time passes there will always be a better format available, but in order to change formats or bit rates you need to re-encode from the original source. Lossless audio takes up more space, but since it’s equivalent to the original source, it’s the last format you’ll ever need.

  1. I rip my music as Apple Lossless whenever I’m ripping from a CD. When I’m buying from the iTunes Store, which only provides 256 kbps AAC, I’m willing to just suck it up and use a lossy format.↩︎

  2. You can also change e.g. the sample rate when you use a lossy encoding. In theory this presents the same problems as choosing a bit rate, except that the sample rate is almost never changed from its original value (44.1 kHz for CD audio).↩︎