MP3 Encoding - how to do it right.

(You can skip the blurb and go straight to the encoding tutorial.)

Many of you will probably be familiar with the following story.

You have just been introduced to the wonderful world of high speed net connections - either at school or at home with a spanking new cable modem or DSL line. Sitting in your dimly lit room late at night, you begin to scan the various networks for some phat MP3's you've been eager to get your hands on - that good old Red Rocks gig that sounded real bad on that high-generation tape with someone down the line setting their levels too low, or that show from two nights ago that's already spreading out.

A few clicks - and you have the show within half an hour. You eagerly push the Play button an begin listening. But - the horror! The shock! It sounds terrible! Crowd noise sound all smushy. Clapping sounds like loud kissing. And the music itself? It's difficult to describe - "Swishy" and "Wavery" are close to what it sounds like. The most badly affected areas of the music are the hi-hat and cymbals - instead of hearind a "tss" or "TSHAAA" you hear some kind of artifacted sound - but it seems to affect most of the music.

You apparently have two choices at this point.

One is to stick with MP3 and suffer in silence, sometimes with RealAudio-like quality.

The other is to abandon MP3 and move on to the lossless SHN like so many have done. I don't like SHN because I know that when done properly, MP3 can sound indistinguishable from the original, and because they are very difficult to access - Much longer download times equals more waiting in line, more disk space needed, more hassle of handling large files. Many people aren't capable (or patient enough) to deal with this, and the bottom line is that they don't get the music.

There is a third solution, but to accept it we need to break some myths.

The first myth is that MPEG-I Layer 3, also known as MP3, is an absolute "standard". It's not. The major portion of what we know of as MP3 was developed by Fraunhofer IIS, a commercial research company based in Germany. As of 1998, they have begun to charge royalties for the use of their MP3 encoding algorithms, as well as various limitations on the usage of their decoding process.

It is hard to distinguish between the various decoders. Decoding MP3 is a fairly well-documented process, and except for a bug affecting Winamp's decoder (which was solved as of version 2.72 dated 1/15/2001) most players work alike.

Encoding, however, was never established as a standard, and since Fraunhofer's method is patented and proprietary, and most of us users prefer free alternatives, there are many different encoders and (to dispel myth #2) they sound different!

There are severeral different encoding "engines", and many software programs that use these engines. Some programs that create MP3 even allow you to select your encoder, such as CD-DA Extractor and EAC. Different encoders create different sounding MP3's because they use different compression algorithms. And here's the major problem: Most MP3 encoders were created and tested to sound good with studio material, and were not built to work with the somewhat noisier, less immaculate recordings we are interested in listening to.

Luckily for us, a team led by Mike Cheng and Mark Taylor has created an alternative: A free, open source MP3 encoder named LAME (for Lame Ain't an Mp3 Encoder - named so because originally it really wasn't an encoder). And, even better news: It sounds better than anything else by far (including Fraunhofer's encoder) and handles live music well, even at low bitrates. An exhaustive explanation of why it sounds better (containing probably more than what most of you want to know) may be found at www.r3mix.net - but all you really need to hear the difference is your own ears.

Go ahead, do some encoding and hear the difference.


Tutorial

First of all, start some downloading. You should first download the LAME engine from here or here (Look for a file named LAME???.zip). You may also wish to view LAME's home page.

If your original is in SHN or WAV files, skip here.

CD to MP3

If your original recordings are on a CD, you need EAC to "rip" and automatically invoke LAME to encode your tracks. Here's how to do it:

1. Download EAC from its home page.

2. Unzip EAC and the LAME engine into the same directory. From LAME you only need to extract Lame.exe.

3. Run EAC, choose the CD-ROM drive you want to use (top menu bar) and insert your CD. The track list will appear. You may now rename the tracks to real names, like "ph94-08-16d1t01" or just "Wilson".

Time to do a bit of initial setting up. Steps 4 and 5 are only done the first time you use EAC (but you must have an audio CD inserted).

4. Hit F10 and dismiss the message that appears.
- Under the "Extraction Method" tab, hit "Detect Read Features".
- Under the "Drive" tab, click "Autodetect read command now".
- There are many more configuration options. Leave them alone for now, and get back to them if you have problems with the ripped audio. Click "OK" when done.

5. Hit F11 (Compression Options) and select the "External Compression" tab.
- Select "Use external program for compression".
- Parameter passing scheme: "LAME MP3 Encoder".
- Program used for compression: Browse and select your LAME.EXE.
- Additional command line options: Type in "-m j". That's MINUS M SPACE J, without the quotes. This enables Joint Stereo mode.
- Bit rate: This is left to the reader's opinion. 128 kBit/sec requires approximately 1 MB per minute (approx 70-80 MB per disc) and sounds fine (try it, you'll be surprised). 192 k/sec is much better, and anything beyond 256 (2 MB per minute, about 160 MB per disc) is overkill. Please don't use Variable Rate.
- Delete WAV after compression: You probably want this, unless you want to keep the uncompressed WAV file.
- Use CRC check: no
- Add ID3 tag: whatever you like.
- and, of course: Select "High quality".

That's it! Hit "OK" and you're ready to roll.

6. Once you've renamed all tracks on the disc, select the tracks you wish to encode (or just select all with Ctrl-A) and hit F5. Select a directory where the MP3's will be saved to, and that's it! EAC will extract all the tracks you've selected and create high quality MP3 files using LAME.


SHN/WAV to MP3

Prepare a subdirectory containing the following:
- LAME.EXE (see above on where to get it).
- shortn32.exe (available
here) if you need to convert SHN.
- The uncompressed contents of this zip file.
- All WAV or SHN files you wish to convert.

Your directory should now contain the files shn2mp3.bat (which encodes SHN files) and wav2mp3.bat (which encodes WAV).

By default, this procedure will create a subdirectory under this directory, named "mp3", containing the MP3 conversions of all SHN (or WAV) files found in the current directory. The default bitrate is 128. These parameters can easily be changed by right-clicking the shn2mp3.bat (or wav2mp3.bat) file, selecting "Edit", and changing the values as you wish.. This will be self explanatory.

When you are happy with your settings, just double click on shn2mp3 (to convert SHN) or wav2mp3 (to convert WAV). That's it!


Back to top.

Questions or comments can be sent to the author of this page, Itay Chamiel, or you may visit my website. Also find more multimedia Phish on IRC Efnet channel #mp3phish. SugarMegs Audio - MP3 Encoding Tutorial ><>-~

MP3 Encoding - how to do it right.

(You can skip the blurb and go straight to the encoding tutorial.)

Many of you will probably be familiar with the following story.

You have just been introduced to the wonderful world of high speed net connections - either at school or at home with a spanking new cable modem or DSL line. Sitting in your dimly lit room late at night, you begin to scan the various networks for some phat MP3's you've been eager to get your hands on - that good old Red Rocks gig that sounded real bad on that high-generation tape with someone down the line setting their levels too low, or that show from two nights ago that's already spreading out.

A few clicks - and you have the show within half an hour. You eagerly push the Play button an begin listening. But - the horror! The shock! It sounds terrible! Crowd noise sound all smushy. Clapping sounds like loud kissing. And the music itself? It's difficult to describe - "Swishy" and "Wavery" are close to what it sounds like. The most badly affected areas of the music are the hi-hat and cymbals - instead of hearind a "tss" or "TSHAAA" you hear some kind of artifacted sound - but it seems to affect most of the music.

You apparently have two choices at this point.

One is to stick with MP3 and suffer in silence, sometimes with RealAudio-like quality.

The other is to abandon MP3 and move on to the lossless SHN like so many have done. I don't like SHN because I know that when done properly, MP3 can sound indistinguishable from the original, and because they are very difficult to access - Much longer download times equals more waiting in line, more disk space needed, more hassle of handling large files. Many people aren't capable (or patient enough) to deal with this, and the bottom line is that they don't get the music.

There is a third solution, but to accept it we need to break some myths.

The first myth is that MPEG-I Layer 3, also known as MP3, is an absolute "standard". It's not. The major portion of what we know of as MP3 was developed by Fraunhofer IIS, a commercial research company based in Germany. As of 1998, they have begun to charge royalties for the use of their MP3 encoding algorithms, as well as various limitations on the usage of their decoding process.

It is hard to distinguish between the various decoders. Decoding MP3 is a fairly well-documented process, and except for a bug affecting Winamp's decoder (which was solved as of version 2.72 dated 1/15/2001) most players work alike.

Encoding, however, was never established as a standard, and since Fraunhofer's method is patented and proprietary, and most of us users prefer free alternatives, there are many different encoders and (to dispel myth #2) they sound different!

There are severeral different encoding "engines", and many software programs that use these engines. Some programs that create MP3 even allow you to select your encoder, such as CD-DA Extractor and EAC. Different encoders create different sounding MP3's because they use different compression algorithms. And here's the major problem: Most MP3 encoders were created and tested to sound good with studio material, and were not built to work with the somewhat noisier, less immaculate recordings we are interested in listening to.

Luckily for us, a team led by Mike Cheng and Mark Taylor has created an alternative: A free, open source MP3 encoder named LAME (for Lame Ain't an Mp3 Encoder - named so because originally it really wasn't an encoder). And, even better news: It sounds better than anything else by far (including Fraunhofer's encoder) and handles live music well, even at low bitrates. An exhaustive explanation of why it sounds better (containing probably more than what most of you want to know) may be found at www.r3mix.net - but all you really need to hear the difference is your own ears.

Go ahead, do some encoding and hear the difference.


Tutorial

First of all, start some downloading. You should first download the LAME engine from here or here (Look for a file named LAME???.zip). You may also wish to view LAME's home page.

If your original is in SHN or WAV files, skip here.

CD to MP3

If your original recordings are on a CD, you need EAC to "rip" and automatically invoke LAME to encode your tracks. Here's how to do it:

1. Download EAC from its home page.

2. Unzip EAC and the LAME engine into the same directory. From LAME you only need to extract Lame.exe.

3. Run EAC, choose the CD-ROM drive you want to use (top menu bar) and insert your CD. The track list will appear. You may now rename the tracks to real names, like "ph94-08-16d1t01" or just "Wilson".

Time to do a bit of initial setting up. Steps 4 and 5 are only done the first time you use EAC (but you must have an audio CD inserted).

4. Hit F10 and dismiss the message that appears.
- Under the "Extraction Method" tab, hit "Detect Read Features".
- Under the "Drive" tab, click "Autodetect read command now".
- There are many more configuration options. Leave them alone for now, and get back to them if you have problems with the ripped audio. Click "OK" when done.

5. Hit F11 (Compression Options) and select the "External Compression" tab.
- Select "Use external program for compression".
- Parameter passing scheme: "LAME MP3 Encoder".
- Program used for compression: Browse and select your LAME.EXE.
- Additional command line options: Type in "-m j". That's MINUS M SPACE J, without the quotes. This enables Joint Stereo mode.
- Bit rate: This is left to the reader's opinion. 128 kBit/sec requires approximately 1 MB per minute (approx 70-80 MB per disc) and sounds fine (try it, you'll be surprised). 192 k/sec is much better, and anything beyond 256 (2 MB per minute, about 160 MB per disc) is overkill. Please don't use Variable Rate.
- Delete WAV after compression: You probably want this, unless you want to keep the uncompressed WAV file.
- Use CRC check: no
- Add ID3 tag: whatever you like.
- and, of course: Select "High quality".

That's it! Hit "OK" and you're ready to roll.

6. Once you've renamed all tracks on the disc, select the tracks you wish to encode (or just select all with Ctrl-A) and hit F5. Select a directory where the MP3's will be saved to, and that's it! EAC will extract all the tracks you've selected and create high quality MP3 files using LAME.


SHN/WAV to MP3

Prepare a subdirectory containing the following:
- LAME.EXE (see above on where to get it).
- shortn32.exe (available
here) if you need to convert SHN.
- The uncompressed contents of this zip file.
- All WAV or SHN files you wish to convert.

Your directory should now contain the files shn2mp3.bat (which encodes SHN files) and wav2mp3.bat (which encodes WAV).

By default, this procedure will create a subdirectory under this directory, named "mp3", containing the MP3 conversions of all SHN (or WAV) files found in the current directory. The default bitrate is 128. These parameters can easily be changed by right-clicking the shn2mp3.bat (or wav2mp3.bat) file, selecting "Edit", and changing the values as you wish.. This will be self explanatory.

When you are happy with your settings, just double click on shn2mp3 (to convert SHN) or wav2mp3 (to convert WAV). That's it!


Back to top.

Questions or comments can be sent to the author of this page, Itay Chamiel, or you may visit my website. Also find more multimedia Phish on IRC Efnet channel #mp3phish.