RSS

How-To Geek

Digital audio has been around a very long time so there’s bound to be a plethora of audio formats out there. Here are some of the more common ones, what differentiates them, and what to use them for.

Before we talk about everyday audio formats, it’s important you understand the basics, and that means understanding PCM. After that, we’ll tackle compressed formats.

PCM Audio: Where It All Starts

Pulse-Code Modulation was created back in 1937 and is the closest approximation of analog audio. That is, an analog waveform is approximated in regular intervals. PCM is characterized by two properties: sample rate and bit depth. Sample rate measures how often (in times per second) the amplitude of the waveform is taken, and the bit depth measures the possible digital values. In terms of audio formats, this is pretty much the foundation.

True sound, in the real world, is continuous. In the digital world, it’s not. Somehow this is more confusing with audio than with video, so let’s look at video as a point of comparison. What we interpret to be “motion” or think of as “fluid” and constantly-moving is, in actuality, a series of still pictures. In that same way, the amplitude of sound waves in a digital format isn’t “fluid” or constantly changing. It’s changing based on certain criteria at pre-defined intervals.

I know there’s a lot here that may not be second-nature unless you’re an engineer, physicist, or an audiophile, so let’s pare it down further with an analogy.

Let’s say that the water flowing from an open faucet is your “analog” audio source. The temperature of the water we can compare to the amplitude of an audio wave; it’s a property that needs to be measured so you can enjoy it properly. Sampling is the number of times per second you dip your finger into the flowing water. The more often you dip your finger into it, the more “continuous” the temperature changes become. If you stick your finger into the running water 44,100 times per second, it’s almost like keeping your finger under there the whole time, right? That’s the basic idea behind sampling.

Bit depth is a little trickier. Instead of using your finger, let’s say you used a really crapper thermometer. It basically said “Hot” for anything above room temperature and “Cold” for anything below. Regardless of how many times you dipped it into the water, it wouldn’t really give you much useful information. Now, if instead of just 2 options, let’s say the thermometer had 16 possible values which you could use to gauge the water temperature. More useful, right? Bit depth works the same way, in that higher values allow more dynamic changes in sound amplitude to be accurately portrayed.

As previously mentioned, PCM is the foundation for digital audio, along with its variants. PCM attempts to model a waveform, in as much of its uncompressed glory as possible. It’s special, it’s ready to be stuck in a digital signal processor, and it’s more or less universally playable. Most other formats manipulate audio via algorithms, so they need to be decoded while playing. PCM audio is considered “lossless,” it is uncompressed, and therefore, takes up a lot of hard drive space.

The Uncompressed Bunch: WAV, AIFF

Both WAV and AIFF are lossless audio container formats based on PCM, with some minor changes in data storage. PCM audio, for most people, comes in these formats, depending on whether you use Windows or OS X, and they can be converted to and from each other without degradation of quality. They are both also considered “lossless,” are uncompressed, and a stereo (2-channel) PCM audio file, sampled at 44.1 kHz (or 44100 times per second) at 16 bits (“CD quality”) amounts to roughly 10 MB per minute. If you’re recording at home for the purposes of mixing, this is what you want to use because it’s full quality.

Lossless Formats: FLAC, ALAC, APE

The Free Lossless Audio Codec, Apple Lossless Audio Codec, and Monkey’s Audio are all formats which compress audio, much in the same fashion that anything is compressed in digital world: using algorithms. The difference between zipped files and FLAC files is that FLAC is designed specifically for audio, and so has better compression rates without any loss of data. Typically, you’re seeing about half the size of WAVs. That is, a FLAC file for stereo audio at “CD quality” runs roughly 5 MB per minute.

The up-side is that if you want to do audio manipulation, you can convert back to a WAV without any loss of quality. If you’re an audiophile and listen to a lot of music with dynamic ranges, these formats are for you. If you’ve got a great set of speakers, cans, or earbuds, these formats will bring out the tones to showcase them.

Lossy Formats: MP3, AAC, WMA, Vorbis

Most of the formats you see in day-to-day use are “lossy”; some degree of audio quality is sacrificed in exchange for a significant gain in file size. An average “CD quality” MP3 runs about 1 MB per minute. Big difference compared to PCM, no? This is called compression, but unlike with lossless formats, you can’t really get that quality back once you strip it in lossy formats. Different lossy formats use different algorithms to store data, and so they typically vary in file size for comparable quality. Lossy formats also use bitrate to refer to audio quality, which usually looks like “192 kbit/s” or “192 kbps.” Higher numbers means that more data is being pumped out, so there’s more preservation of detail. Here are some details for the more popular formats.

Vorbis: A free and open-source lossy format used more often in PC games such as Unreal Tournament 3. FOSS fans, such as many Linux users, are bound to see plenty of this format.

AAC: Advanced Audio Coding, a standardized format now used with MPEG4 video. It’s heavily supported because of its compatibility with DRM (e.g. Apple’s FairPlay), its improvements over mp3, and because no license is needed in order to stream or distribute content in this format. Apple fans will probably have plenty in AAC.

WMA: Windows Media Audio, Microsoft’s lossy audio format. It was developed and used to avoid licensing issues with the MP3 format, but because of major improvements and DRM compatibility, as well as a lossless implementation, it’s still around. It was really popular before iTunes became champion of DRMed music.

Lossy formats are what you use for all of the stuff you listen to and store. They’re designed to be an economy of hard drive space. Which format you choose depends on what digital audio player you use, how much space you have, how big of a quality nitpicker you are, and a bunch of over variables. Nowadays, computers will play anything, most audio players (except Apple’s, of course) will do multiple lossy formats, and more and more do FLAC and APE. Apple sticks to MP3, ALAC, and AAC.

Isn’t Audio Quality Subjective?

Absolutely, it is. Ultimately, it’s your ears that are consuming most of this stuff, but that’s more reason to think of quality seriously. When I first started creating my digital music collection, I couldn’t really tell the difference between 128kbit MP3s and audio CDs. To my ears, there was no noticeable difference. Over time, however, I noticed that 256 kbit sounded much better, and after I got a really nice (and expensive!) set of headphones, I went back to audio CDs full time! It also depends on the genre of music.

There are a LOT of variables here, folks, make no mistake about that. It took a while before I settled on using FLAC for some music and 320kbps MP3 for the rest. The point I’m trying to make is that you should experiment to see what works best for you and your music, but be aware that as your tastes change, your perceptions, your equipment, and the importance of quality will, too.

And all of this stuff get even trickier when you’re not just talking about music, but about voice tracks, sound effects, white and brown noise, etc. There’s a whole world of sound out there, so don’t get discouraged! By learning what you can and listening for yourself, you can use this info to your advantage in your future audio projects. I’ll leave you with some of the best advice I’ve ever gotten: “do what just plain sounds good.”

I had many of my audio CD’s ripped in higher bit rate but later settled for 128 bit rate so I can save space and also I did not find any major difference in the audio quality. This was because of the hardware limitation I had. After reading this article I have decided to rip the CD’s in higher bit rate. Some time later I will surely settle for any one of the loss-less format if I get an expensive audio player.
This article is very informative.

I download Flac and convert it back to WAV. Anything short of a WAV or flac is degrading our music to it’s lowest level. At some point you will want to hear your music over a descent audio system and if you use Flac or WAV you will hear the edginess and harshness of your recordings……
Who wants your ears to bleed?

Yatri Trivedi, I’m a fan of your articles. They all have excellent information.
PCM audio was a little hard to grasp to me. Still, I didn’t knew all these stuff and now, I feel much informed.
I completely agree with this:
“do what just plain sounds good.”

“Anything short of a WAV or flac is degrading our music to it’s lowest level”
wow, just wow.

first of all, I work in the engineering/audio/acoustics area, not saying that *I* am the ONE to listen, and that *I* am right, but you can trust me on this:

A mp3 file con 192 kbps is just good/fine as a 1.2 Mbps wav file.

you might say, “that’s not true, because of the mp3 algorithm erasing some data and the lossy format.. ”
but consider this….

in acoustics/sound area, we have something called “electro-acoustic system”, in short, we have a chain in which you have an input signal, and an output signal. For example, we have a electric signal (.wav file, .mp3 file, etc). at the output we have the acoustic signal (air moving like a “slinky”), in between exist an electroacustic system to transform the input into the output.

so, long story short… are you SURE that the chain is perfect?
have you considered the cable? the connector? the A/D conversor?, the quality of the speakers?, the acoustic properties of the ROOM you are listening in?

you may have a 1.5GB loseless .wav file next to a 15 MB 256 kbps mp3 track, but it makes no *big* difference at the end when you have so much factors in between.

Rather than 320kbps MP3, try encoding to “-v0” (which is the LAME MP3 encoder’s highest quality variable bitrate). It’ll go up above 320kbps when necessary, but keep the bitrate lower when the dynamic range is smaller… resulting in a smaller file size (roughly equal to a 225kbps mp3).

I disagree with your statement, “It also depends on the genre of music. “…. it really doesn’t, it depends more on the recording/production engineers… and how much they compress the music to try and make it louder, decreasing the dynamic range.

We were looking at mid-range audio systems (not theatre systems) on the week-end. My role was to hook up each set of speakers and skip to specific tracks to my spouse’s specs, etc., (i.e. gopher) while my spouse sat and determined sound quality and directed my movements. When it comes to acoustic ability, she is WAV while I am at best MP3 (sigh)

You are partially correct in that it ultimately will only be as strong as the weakest link in the signal chain, but that is not the entire picture in all scenarios. Each degradation in the chain can be cumulative. A little bit of loss here & there can add up over the signal path.

I agree, that just because a lossy format is being used, everything is not automatically degraded to it’s lowest level, as Kory clearly exaggerated (for effect I assume – Kory, I also prefer lossless wherever possible). I also agree that not everyone has the same needs, and for a number of people, a 192 kbps is totally fine with them.

But as someone who works in the audio engineering area, I wouldn’t expect such a careless attitude. Garbage In = Garbage Out.

More importantly, once the data is lost, it’s lost. You’d have to re-acquire a higher fidelity recording. If you record everything at 160 kbps MP3, and later upgrade your computer setup to a sweet DAC-1 with beautiful Adam A7x monitors, & even add some acoustic treatment to the room, well, you’re still stuck at 160 kbps.

Also, if you decide to do any processing what so ever on the MP3, even for just some home video or something, I’m sure you know that you want the best source possible, as artifacts can get worse & worse thru various processing.

And lastly, a 15 MB mp3 @ 256kbps would not translate to a 1.5 GB WAV file, more like a 150 MB file, assuming standard 44.1 kHz @ 16 bits.

Don’t take this as a personal attack, because it is certainly not. I just wanted to present some perspectives to your arguments.

While some of these users commentaries’ may be right about argument between lossless and lossy, I’m sorry, when it comes to classical music the argument falls apart. MP3, even at 320 KHZ is not able to accurately capture all the resonance of both concert hall and orchestra alike – it just isn’t.

Let us not forget the reason a CD is 74 minutes long is allow classical music to be recorded completely on one disc.

Plus, hard drives are so unbelievably cheap now that i do not understand why people wouldn’t have everything in lossless.

The graphic at the top of the article seems to imply that you’ll discuss M4A, but I don’t see a discussion of it in the article. That’s the one I don’t understand – who invented it, what’s good about it, what’re the drawbacks, what programs rip in this format,,why won’t it play on Windows Media Player….

@Felipe: I hope you back-up lossless sound files. What would happen in the future if suddenly the next big thing came around and the quality of technology increased by several thresholds? Lossless files are relatively future-proof.

I have used Apple lossless for everything over the past couple years. This is great as long as I stay with Apple / Itunes. However, what if I want to switch to FLAC? Is it possible to convert from one lossless format to another without a loss of quality?

I have tried researching this question multiple times and could never find a satisfactory answer. ALAC is great, but I hate being locked into Itunes and Ipods with this format.

Some of them are technical different but all of them have something in common:
Made by people that cannot accept that there are other and/or better engineers that allready build or are building a new format. The other thing is that companys want to enslave consumers and/or manufacturer with their products. AppleLossless, FLAC, wav, etc. All lossless … same but different

Article didn’t mention that when creating MP3s there is a choice of how much loss you want. In the same way you can make lossless .jpg files by setting the quality to 100% you can make 100% quality MP3s. I am not an audiofile, but I believe these settings control the frequency limits (indirectly) and the bit rate to knock down the quality and thus the file size – if one chooses. This may be true of the other lossy methods described as well. This has always been the case, and I never have figured out how ITunes can sell DRM’d songs, and for more money, when MP3s have been there since near the beginning of popular computing. Marketing at it’s best I guess.

It would be better if you pushed WMA Lossless and other lossless variants into the actual Lossless section as they get lost below.

Also many portable devices and distribution systems like SONOS can’t deal with *any* bitrate over 320, so lossless, and high VBR lossy formats cannot be used.

If you’ve got a car stereo that handles “MP3 CDs” then they’ll most likely handle MP3 and WMA up to 320kps, and some newer ones will do AAC. Even “ipod-compatible” car stereos may only handle AAC which happens to be on an iPod/iPhone, and won’t process them if they’re on a CD-ROM.

“Plus, hard drives are so unbelievably cheap now that i do not understand why people wouldn’t have everything in lossless.”

Lossless really chews through HDD space. I have 3000+ albums and now opt for 320kps or VB0 MP3 files mostly for several reasons which compound with each other.
1. In order to use the music with portable devices (and SONOS) I have to have a non-lossless version.
2. You really need to have 2-3 copies of the library for safekeeping, especially if you’re buying music over the internet and no longer have physical CDs as an ultimate backup.

I generally rip everything to a local hard disk and then replicate the lossy files to a NAS drive for wireless distribution through the house. I keep offsite backups as it’s so easy for corruption or deletion to occur.

Plus I’m no longer a 25yo eagle-eared listener, and would be extremely pushed to tell the difference between good lossy and lossless versions even if vanity would have me say otherwise.

@Biff Tricky: All lossless formats, whether WAV, FLAC, WMA etc are mathematically equivalent so you can always convert between them. Compressed lossless formats are like ZIP files for audio.

@L: M4A does play on Windows Media Player 12 (and maybe also 11, I forget).

One of the reasons for multiple formats is that mainstream players want to avoid paying license fees to other players for use of a format or its codecs. They want *certainty* that a format choice isn’t going to bite them legally a few years down the road.

Open source does NOT mean that there are no license encumbrances – a license like Copyleft (in its strong form) can impact a company’s codebase if it incorporates adversely licensed modules. Even the mess over MP3 rights a few years ago ( or of ZIP and GIF in earlier years) points to how delicate this can be. These wars have not ended – look at what’s going on with multimedia formats in the HTML5 space, and Google’s reach in terms of its Chrome browser and ownership of YouTube.

Great article first off!!!
But I would really like to know if anyone knows where to get the WMA lossless codec command line (I use foobar2000 to convert)? When I buy music online it is sometimes in FLAC, which is great but FLAC doesn’t play on my Zune. Basically I end up burning the CD and ripping again in WMA lossless. This way when I play classical music in my car I can actually hear it…

I recently downloaded about 12,000 songs into my pc. None of the songs will play on my itunes. Later, I figured out that the external hard drive was mac formatted. Does anyone have any suggestions to resolve this? Would greatly appreciate any suggestions!

I’m trying out the little known Tak format right now. It has the best compression rate but is still relatively light on system resources, both when you encode and decode. I use max compression for both Flac and Tak and so far the Tak files are 3-4% smaller than the Flac files.

Are the audio files on your computer in a format unknown to iTunes? In that case: Which format? You might be able to convert the files to an iTunes friendly format.

Or are the files stored on an external drive that you computer can’t access because the file system isn’t ntfs or fat? I’m not a Mac person but I guess you’d be able to get access to the files with an Ubuntu live cd. Just boot from the live cd, find the files on the external disk and drag them to your internal disk. Maybe someone else can confirm that this would work?

Why are you sticking to mp3, you went the right way with Flac it’s the best lossless out there, but mp3 is not only ancient but the quality is horrible. At least use AAC, and if you can use Vorbis, it’s the best of the three lossy you mentioned and you won’t be able to notice the diference between a Flac file and a Quality 6 Vorbis. Try it out it’s the best, I rip all my music in Flac, and convert everything to ogg vorbis for lossy hearing, best of both worlds, plus if you use the right encoder go to hydrogenaudio they will recommend aotuv Beta 5,7 , encoding in the lower qualities q-1 , q -2, q-3 it’s amazing/

MIKE: Why do you have MP3 same as I told the writer, it’s an old dying format it might still be around but don’t copy your music into it. Try something that sound better and keeps a lower bitrate example Ogg Vorbis, it’s the best of the three lossy formats and has been for as long as I can remember, it’s been proven over and over again.

@Felix: If you think that MP3 is a format that is going to be useless to me in my lifetime, you’re smoking something. I’d say that before this new decade is out, a chip will probably be able to intelligently decode ANY non-encrypted format as a trivial exercise.

My ears aren’t going to get any better. I’m not so desperate for space that I need to have a lower bitrate, and I also need a format that is used widely *now*. Most of the devices I use won’t accept anything other than MP3, WMA, AAC, FLAC and WAV – and I’d rather not spend my life maintaining multiple collections that have to be transcoded for use.

“… but unlike with lossless formats, you can’t really get that quality back once you strip it in lossy formats.

Here is my question: When you convert an MP3 to a wav, the file size increases to it’s original size. Since the info was lost when it was converted to MP3 originally, why does the size blow up again? Where is it getting that extra data? It makes sense (to me) that if the file was reduced to 3 MBs, it should stay that size if you convert it back to wav, since no more data is being introduced.

Correction perhaps:

Most of the formats you see in day-to-day use are “lossy”; some degree of audio quality is sacrificed in exchange for a significant [gain] (Shouldn’t this be “loss”) in file size.

Once took a CD ripped wav file, I compressed it using a common zip program intended for data files.

I also compressed the same source file using a few MP3 encodings and one vorbis. In my tests, zip compression was smaller than a few MP3 encodings (and when zip was larger, I do not remember more than 10% larger than the MP3 files), and, finally, remember: zip is lossless, always has been lossless.

If zip was a lossy format, your archived copies of programs will be in danger of not operating properly, so why would you have trusted zip back when you first compressed? Zip encoding includes several compression algorithms and even different sequences of those same algorithms can change the compression factor. Zip is more of a container and LZW is one of the compression processes used, but you get the idea, right HTG?

Disclaimer: I’m sure my lamer test was not representative compared to the existing body of MP3 compressed works, so before you berate me, why not just try it and see for yourself?

@john q: Imagine adding a file to a ZIP archive. The ZIP archive is the MP3 and the file inside it is a WAV. Files inside ZIP archives are compressed. When you unzip them they return to their original size. When you convert an MP3 into WAV, the data is, in a way, unzipped. That’s why a 5 MB MP3 converted to WAV is much larger than 5 MB.

Note: Although this is a bad analogy when comparing lossy formats (because you can never get the uncompressed quality back from an MP3 like you do from a ZIP archive) I think it will serve its purpose. This would be more correct if we were comparing a lossless format to another lossless format.

Help please. I have no problem downloading mp3 format, but when I download any wma format and try to play it, it says “media error”. It looks like it downloaded, but won’t play. Is their something need to know? Anyone. Thanks.

First PCM ain’t exactly lossless, 16 bit grade more likely, this really comes in focus when you digitize something in even less bit (12, 8, 6, 4)… But the quality is fine enough. I myself prefer 24 bit, but it’s reallz hard to come by.
Second when quality – size issue is considerable I use Variable bitrate, less compression on “rich” music, maximal on silences.

DID YOU KNOW?

If a super-skilled and risk-loving contestant were to play Jeopardy as aggressively as possible while getting every question right and nailing every opportunity for a Daily Double, the total amount of money they could win in a single game would max out at $566,400; the most any contestant has won in a single game to-date, however, is a still-impressive $77,000.