The ABCs of Lossless Music Files

Lots of people like to use lossless digital music files. These are files that reproduce exactly what is on a CD, with no loss in quality; they can even go further, offering high-resolution capabilities, with bit depths and sample rates well above that of CD.

One of the advantages of lossless files is that, when decompressed, they are bit-perfect replicas of your CDs (or digital downloads). When you rip a CD to a lossless format, then play it back, iTunes, or other software, converts the file to the exact same digital stream as was on the original CD.

This can be confusing. In a recent Ask the iTunes Guy column on Macworld, I addressed a question about that. A reader had written in:

“I read your column regularly, and really appreciated your recent explanation of AIFF, WAV, and Apple Lossless formats. But I don’t get it; how can the file size of Apple Lossless be half that of AIFF without some voodoo going on?”

My reply was:

“I received this email with the subject: Apple Lossless, Magic?. And I can understand that it can seem like there’s some voodoo in this process, but it’s actually pretty simple. (At least the concept is simple; the math behind it is a bit above my pay grade.)

“Imagine that you have a text file with, say, the complete works of William Shakespeare. This text file contains 908,774 words, and takes up 5.6 MB on disk. If I compress the file using OS X’s built-in Zip compression, the same file takes up just over 2 MB, or about 36 percent of the original file size.

“Lossless compression for audio works in a similar way. Unlike, say, AAC or MP3 files–where psychoacoustic models are used to determine which parts of the audio can be removed without affecting what you hear–lossless compression formats simply compress all of the data in a file. When played back, these files are decompressed on the fly, so the compressed data becomes audio data again, in a bit-perfect equivalent to the original. Nothing is lost, just as none of Shakespeare’s words are lost when I decompress the zipped file.”

But there’s another thing you should know about lossless files. You can convert from one lossless format to another, back and forth, without losing any data. (This, of course, assumes that you have no hard disk glitches or the like.) So, when a reader wrote me today asking some questions about AIFF files, I asked why he didn’t use Apple Lossless? He can save half the space with the same quality.

Here’s an overview of lossless audio file formats:

  • AIFF: These are files that take raw PCM (pulse-code modulation) data from a CD and wrap it in a header so it can be used on a computer. AIFF files are commonly used on Macs.
  • WAV: These are similar to AIFF files, but more commonly used on PCs.
  • Apple Lossless: This is a format that Apple created, then later released as open source, which compresses losslessly, so the resulting files take up roughly half the space of the original AIFF or WAV files.
  • FLAC: These are files in the Free Lossless Audio Codec format. iTunes does not support FLAC and probably never will.

(Note that the above are the main lossless audio formats, the ones you’ll encounter frequently. There are a few others that are not broadly supported: Monkey’s Audio (.ape), WavPack (.wv), Windows Media Audio Lossless (.wma), Shorten (.shn), etc. One could also add DSD – Direct-Stream Digital – files to the list; these are very-high-resolution files used to make super audio CDs (SACD). These are starting to be sold as digital files.)

You can rip CDs in iTunes in AIFF, WAV or Apple Lossless. You can buy music by download in FLAC and Apple Lossless, with some sites also selling AIFF and WAV files.

It’s important to note that, if you use iTunes, WAV files are problematic, since they don’t support tags or album art very well. AIFF files do, as long as you keep them in your iTunes library. When you move them, some of the metadata is lost. If you want to use lossless files with iTunes, Apple Lossless is the way to go.

But, since you can convert these files easily, and for the best metadata support, I recommend that you use Apple Lossless files. Use the free XLD, or X Lossless Decoder, to convert from one lossless format to another.

If you want to keep a library of lossless music, save the space; don’t use AIFF or WAV, because there is no difference in the audio quality (despite what some audiophiles claim). But given the low cost of storage space these days, there’s no reason any more to not rip CDs in lossless formats. They offer the same quality as CDs, and they’re flexible: you can convert them to lossy formats at any time, retaining the higher-quality originals. And iTunes can even convert them on the fly when you sync an iOS device, so you don’t overload that iPhone or iPad.