Home
About
Adventures
Projects
Pictures
Links
Contact

Mp3 Compression

 

Once you have a CD which you are satisfied with, you'll need a program to rip and compress it. There are a million and one programs, some standalone, others built into programs like iTunes and WinAMP. I've been using the free CDex for the past ~6 years with good results. I've recently discovered however that if it hits a bad spot on a disc, it usually just goes ahead and produces an Mp3 with audio errors in it instead of alerting the user. This hasn't been a problem for me so far since I inspect my discs carefully before ripping, but it's probably safer to use a program that's more transparent. Audiophiles often speak highly of Exact Audio Copy. I find it to be far harder to use though, so I won't be attempting to cover it here.

Anyway, whatever program you choose to use, you'll want to take a moment to poke through its encoder settings before you start. Anything that encodes Mp3s should have a settings menu in it for setting up the encoder. In my case they look like this:

Here I have already set the program to my preferred profile. Let's look at the details.

The Encoder or Plugin is the little piece of software which actually does the compression. Every different type of media file, be it Mp3, FLAC, JPEG, etc, requires an encoder to turn data into that type of file. Furthermore, there are often several different competing encoders from different groups and companies available for a given type of file, each having their own benefits. Since we're wanting to make Mp3s, we need an Mp3 encoder. LAME is incredibly popular and has been around for ages. It's a strong contender for producing the best quality Mp3s out of all the currently available encoders. It's also free. If you have a program that uses an older version of LAME, or allows you to specify your own plugins, you can grab an up-to-date and windows-ready version from here. It's a good idea to use the latest Mp3 encoder, as even LAME is still finding ways to improve.

Next we have the Encoder Options. This lets us tweak how the encoder works. Every program will look a little bit different here, but if they're encoding with LAME, then all but the most simplified should offer the above options.

Version should be set to MPEG 1. This is the default for music, and with good reason. The others are limited to low bitrate operation for specialty applications. You should have no reason to change this.

Bitrate is slightly complicated. Despite being the most commonly discussed number, it's rapidly becoming the least important factor. Just like the Megahertz myth around CPUs, the bitrate alone is not enough to determine the quality of a given Mp3. It will be easier to understand why in a minute. So for now move on, we'll be setting the bitrate last.

Mode I recommend setting to Joint Stereo. Standard stereo works as you would expect, with each stereo channel being encoded as one track or "stream" in Mp3. It's simple but wasteful. In most songs, one channel sounds a lot like the other. So when you turn on Joint Stereo, you tell the encoder to store one channel the traditional way, then compute the difference between the two channels and store just the difference information as the second. When the Mp3 is played back, the player reverses the process and regenerates the second channel. The end result sounds no different from standard stereo, but takes up less space. There's long been a rumour that joint stereo also downmixes certain high and low frequencies to mono, since our ears are unable to tell what direction they're coming from anyway. I don't believe this is true though.

Quality. This is a very misleading setting. First off, the highest quality is 0, and the lowest is 9. That sounds backwards, but that's how it is. Secondly, the name isn't very clear. It sounds like this might the option to change when you want a smaller, lower quality Mp3. But that's wrong. In fact changing the encoder quality alone will have little or no effect on file size. It doesn't help that it's often mixed in with presets which alter other settings to give that result. A better term for it would probably be laziness.

What this setting actually does is tell the encoder how many shortcuts it can take during the analysis and compression process. How many corners it can cut. By setting it to 0, you insist it does everything properly and by the books. Setting it to 9 allows it to be very ham-fisted. Why would you want that? Well, you probably wouldn't any more, but Mp3 encoding has been around since 1993. Now if you had been rich and successful in 1993, your computer would probably be running Windows 3.1 and have a 486 in it. Otherwise you might still be using a 286 under DOS. The first computer to come with a CD-ROM drive, the Apple Macintosh IIvx, had only just come out a few months earlier, and it was crap even by the standards of the day. So ripping a CD was not the simple and fast task that it is today. It could take literal hours to encode a single Mp3. Days to get through only a handful of tracks. As such it was the norm for people to reduce the encoder quality to speed things up. Back then you were probably compressing the files so hard to save space that reducing the encoder quality was just another drop in the bucket. But now that we have 8 core CPUs and double digit gigabytes of RAM, it probably takes us longer to find a CD on our shelves, take it out of the case, put it into the drive and open an audio program than it does to actually compress the resulting files. So we always always always want to set the Encoder Quality to maximum (0).

VBR Method. Now would be a good time for me to explain VBR vs CBR. The normal boring every day method of Mp3 compression which has been around forever is called CBR, which stands for Constant Bit Rate. This tells the encoder to allocate the same amount of space to every second of an audio track no matter what. It doesn't matter if it's a recording of someone coughing or the middle of a 100 piece orchestra's rendition of the 1812 overture, it will use the same number of bits regardless. While this works just fine, it's very wasteful. So a more clever method, called VBR or Variable Bit Rate, was dreamed up. With VBR the encoder considers every section of audio very carefully and decides how many bits it would take to encode it with the desired level of quality. That means the bitrate can drop to almost nothing during the silence before and after a track, shoot up to somewhere in the high hundreds as the song starts, and peak at the limits of the encoder during particularly delicate passages. This is much more efficient, and allows for a higher quality recording in the same space as a plain old CBR file. Now I will admit there was a time when VBR was not very good. The methods it used to determine just how many bits a section needs left a lot to be desired. But 20 years later it's been refined through countless hours of dedication by its developers to the point of working like a dream. So I highly encourage you to use VBR-New if you're using a remotely modern Mp3 encoder. And I likewise encourage you to use a modern Mp3 encoder.

VBR Quality. As if the Quality setting above weren't complicated and misleading enough as it was, THIS one really does work in the way you would expect. VBR quality is the setting which biases the VBR analysis engine toward higher or lower bitrates. In other words, it tells it to favour higher audio quality or smaller file sizes. If you're using VBR, (which I hope you are!) you can use this setting to control what bitrate your Mp3s average. Again, 0 is the best and 9 is the worst. 0-2 is often considered the range for the very best Mp3s. And if you intend to do your listening with earbuds on a train or something, lower quality would no doubt do just fine while saving space. You may find the listening tests page of this article to be helpful in selecting a quality level.

Output Samplerate. This should always match the input samplerate. For CDs and most audio files it will be 44100. In the past people would set it to lower settings to save space, but oh, does it do a number on the sound quality! So please, leave it at 44100.

Now we can finally talk about the Bitrate. Despite how much people talk about it, if you're using VBR, there's no need to manually set a bitrate at all. Instead this option allows you to limit the range which the VBR engine will work in. And in the vast majority of cases, doing so will only either cause the encoder to sound worse, or to waste space. So you want to open this all the way up, allowing a minimum bitrate of 32 and a maximum of 320. If your Mp3s are tending toward a lower average bitrate than you want, don't force it higher by setting a minimum, instead turn up the VBR quality field. Trust in the VBR engine and it won't go lower than is appropriate.

If for some reason you're using CBR instead of VBR, then the bitrate field is the main way you adjust between small file size and high audio quality. The highest quality is 320 and the lowest is 32. Exactly what number is ideal for you depends on a number of factors. Do you listen with high quality speakers or headphones, or are you using cheap ear buds? Do you play your music in a quiet room, or are you outside on a loud bus? These things will alter the perceived quality of any audio file, Mp3 or not. Once again, I highly suggest using VBR, as it allows both for higher quality and smaller space at once. But if you really need CBR, 320 and 256 are safe bets if you want the very best. 192 or 160 are probably fine if you're listening under less than ideal conditions. Again, you may find the listening tests page of this article to be helpful in selecting a bitrate.

If you've made it this far, you're done! The Mp3 encoder is now correctly set for quality.

Have a look through the other settings window of your program and you'll find options like file naming schemes and the default folder for putting ripped songs in. If your program supports auto tagging with CDDB, you'll probably need to enter your email address in the settings somewhere to enable it.

Now we're ready to rip!

This is what we see when we put a CD in the drive. All the tracks are shown, but this program doesn't know the names of them. So we select Read Remote Freedb under the CDDB menu, or click the magnifying glass icon on the right.

We see this flash by...

And like magic, all the information is filled in for us. It's a good idea to check each track name for typos though. Now press the second button down on the right, or select Extract CD track(s) to Compressed Audio File(s) under the Convert menu.

Away it goes!

Less than 5 minutes later we have a nice folder full of Mp3s.

Like most CD rippers, CDex allows for quite a bit more customization, so much so that I won't be able to cover it all here. But this should be enough to get the music flowing. If you want to further refine your quality settings, or confirm that they sound as good as you want them to, check out part 3 - Listening Tests

Last modified September 30th 2013

Let's see how fast this thing can go