The old version of LAME 3.98.2 encodes better than the current one (3.100)

For years I used old versions of Audacity that worked with LAME 3.98.2 [rectified] and exported music files in mp3 format at 128kbps resolution. Being a compressed format, I assume there is a loss of quality, but for me it was imperceptible to the ear.

Now that I have a new computer I have updated Audacity to the latest version (3.1.3), which incorporates the latest version of LAME (3.100). However, when exporting music in mp3 format at 128kbps I was very disappointed, because with the new version of LAME I clearly hear the loss of quality.

To make sure it wasn’t a kink of mine, I’ve tried importing and exporting the same music file five times in succession with both versions of LAME, using both the old and the new computer. The result is that in both cases there is an obvious deterioration in audio quality, but the loss is much more serious using LAME 3.100. To my knowledge, the test result confirms that the latest version of LAME encodes worse at 128kbps compared to the previous one.

The problem is that Audacity 3.1.3 embeds LAME 3.100 into the program and doesn’t allow you to use LAME 3.98.2 [rectified]. Therefore, to export music in mp3 format at 128kbps I will have to install an old version of Audacity on the new computer, hoping it will work. I don’t see any other solution. It’s a shame.

Strange. But are you using Joint Stereo? Joint stereo combines the sounds that are the same in both channels so this information isn’t compressed and stored twice. That generally gives you better quality and this part of the process is 100% lossless and reversible. And it’s “smart enough” to skip this when it doesn’t help.

If you are not required to use constant bitrate, you can also use Average bitrate (ABR) for an overall 128kbps with the “bits” used where they do the most good.

Do you NEED 128kbps for some reason?

As far as I know there haven’t been any [u]changes[/u] that affect sound quality (or that are supposed to affect sound quality) for many years.

Being a compressed format, I assume there is a loss of quality, but for me it was imperceptible to the ear.

Yes. Information is thrown-away to make a smaller file. A lower bitrate means a smaller file… More compression and more data thrown-away, so generally lower quality.* It uses “psychoacoustics” to try and throw-away “little sounds” that are drowned-out by other sounds so you don’t hear them anyway.

128kbps is low by today’s standards. I just checked a song I downloaded from Amazon and it’s 256kbps. When I make an MP3 I use a high-quality variable bitrate setting and it (always?) turns-out higher than 128kbps.

Just for reference, CD audio is 1411 kbps so a 128kbps MP3 is about 1/10 the size. FLAC is lossless compression and you can get a file almost half the original-uncompressed size.

kbps is kilo_bits_ per second. There are 8 bits in a byte so you can divide by 8 to get file size in kilo_bytes_ per second. (Embedding artwork makes a bigger file and that’s not included in bitrate so the file may be larger than calculated.)

I will have to install an old version of Audacity on the new computer, hoping it will work.

There are 3rd-party “conversion” programs like [u]Kabuu Audio Converter[/u] (FREE) so you could export as WAV or FLAC and then convert to MP3. But these may also use a current version of LAME.






***** We can’t say a higher bitrate file is better quality unless it actually sounds better. If a 128kbps file sounds identical to the original we can’t say a higher bitrate is better. Some material is “easier” to compress than others and some people are better at hearing compression artifacts. And at higher bitrates there are sometimes compression artifacts that aren’t related to bitrate.

The idea behind variable bitrate (VBR) is that it can use a very-low bitrate during silence or for “simple” sounds and a higher bitrate when it’s needed. With VBR you choose a quality setting and the software chooses the bitrate. (My standard setting is “V0” which is the "best variable bitrate.)

Yes, I always use “joint stereo”, the default option in Audacity. I encode the music at 128kbps because for me it was the best option: if I don’t notice any loss of quality, why increase resolution by creating larger files? However, with LAME 3.100 I will no longer be able to export the files at 128kbps because the quality loss is obvious, unless I install an old version of Audacity that uses LAME 3.98.2 [rectified] and it works on the new computer.

I don’t know what the internal changes have been in the latest version of LAME, but they clearly affect the sound quality. As I say, I have imported and exported the same file five times in a row with both versions and it is evident that the audio quality deteriorates more with 3.100. I have also noticed a small improvement: this latest version respects the absolute silence that may exist at the beginning or end of a file, while the old one always incorporated a minimum level of noise, negligible under normal conditions but noticeable if the music player adjusts the volume automatically, amplifying the volume at the beginning before the music starts: if the silence is absolute, no matter how much the player amplifies it, nothing is heard, but if there is a minimum of noise, it is amplified and clearly perceived.

However, this small improvement from the last version by respecting absolute silence does not compensate for the obvious loss of quality when encoding music at 128kbps.

I have done some testing with both pop musc and classical music and my ears cannot detect any difference between MP3 exports made with LAME 3.99.3 (the one we get from the recommended site by Buanzo) and LAME 3.100 (the one that comes bundled with Audacity 3.1.3).

I can however detect a difference between the MP3s and the WAV file of the same music, the WAV is brighter, there is a slight dulllness to te MP3s, there is more bass presence in the WAV - and I think the WAV stereo image is gripped better.

I am importing known WAV files, ones I created when I ripped ny vinyl. I am exporting MP3s as Constant bit rate 128kbps joint stereo. I am listeninng on high quality Bowers & Wilkins hi-fi wired headphones.

My experimental method is

  1. launch Audacity 2.3.0 (with LAME 3.99.3 installed)
  2. Import the WAV file
  3. Export the MP3 to OLD LAME.mp3
  4. close Audacity
  5. Launch Audacity 3.1.3 (LAME 3.100 built-in)
  6. Import the WAV file
  7. Export the MP3 to NEW LAME.mp3
  8. play all three files with Windows Media Player
    then
  9. import OLD LAME.mp3 and NEW LAME.mp3 into the project that has the WAV file
  10. Play the project in Audacity
  11. Use the Mute buttons to listen carefully and comparatively the three tracks individually

I can detect a possible slight difference between the two MP3s with this further experiment
12. Select NEW LAME.mp3
13. Effect > Invert
14. Select both OLD LAME.mp3 and NEW LAME.mp3
15) Tracks > Mix > Mix and Render to new track
16) Observe the mixed track is not a flat line thus the two MP3s are not identical - but note the the difference is very small.

You may wish to try this experiment and report back.

=================================================================

Aside: when I bought my first iPod and started digitizing my LPS I experimented with MP3 sizes
a) I could definitely hear the difference between 128 and 192
b) I could definitely hear the difference between 192 and 256
c) my first iPod was small so I settled on 192 as a compromise.
d) my iPod now is a 160GB Classic - so now I use 256

But note that my son, who is a purist, insisted on using 320 - and then ran out of room on his 160GB iPod!

Peter.

Peter, thanks for the attention and for the answer.

I refer to version 3.98.2 [rectified] of LAME because I have always worked with Mac computers. I see that version 3.99.3 is for PC and I don’t know if they correspond and if they encode the same.

Maybe my hearing is not perfect or maybe I’m not wearing the right headphones, but exporting and saving music with LAME 3.98.2 [rectified] at 128kbps I could never hear the loss of quality that certainly occurs with respect to the original file. So I tried exporting at lower resolutions: at 96kbps I get a file in which the music sounds good as a whole, without artifacts, but if I select a short passage where there is a drum sound or some percussion instrument and listen to it successively at 96kps and at 128kbps, I notice that at 96kbps the battery loses some brightness and starts to sound like brass. But I only notice the difference by comparison: if I only listened to the recording at 96kbps, I would give it as good as it contains no artifacts. And in the passages where there are no percussion instruments, I can’t appreciate differences between 96kbps and 128kbps exporting with LAME 3.98.2 [rectified].
On the other hand, below 96kbps, the deterioration in sound quality is evident without the need to compare resolutions: at 80kbps or less, the music sounds bad from the start and generates rejection in the ear.

For me, the poor quality of the files exported with LAME 3.100 at 128kbps is due to the fact that I detect the typical artifacts produced when the resolution is insufficient, artifacts that I have never detected exporting with LAME 3.98.2 [rectified] or even trying at 96kps, although I always save the files at 128kbps to avoid that minimal loss in the passages with percussion instruments.

In other words, on the whole, music encoded with LAME 3.98.2 [rectified] at 96kbps sounds better to me than with LAME 3.100 at 128kbps. It is a pity that the latest version represented a loss of quality and not an improvement.

I can’t test on Mac with version 3.99.5 of LAME right now as I am away from home for a while.

I suspect that I won’t even be able to test it when I get home as my Mac is a 64-bit Macbook Pro and Apple prevents me from running 32-bit apps on that Mac - and thus I am unlikely to be able to run a suitable older version of Audacity to use 3.99.5 LAME.

But I will bookmark this page and see what I can do later.

Peter

I have to rectify a mistake. The version of LAME that I have on my old computer is not 3.99.5 but an earlier version, 3.98.2. Therefore, I should have titled the message “LAME version 3.98.2 encodes better than the current one (3.100)”. I have corrected this error in all my previous posts.

Maybe you’re ear is getting better at detecting artefacts.
Referring to the list of changes by version, I don’t see any changes that could affect the sound quality - just bug fixes: LAME MP3 Encoder :: Site Map

I accept the joke but insist that there are differences between the encoding using version 3.98.2 (not 3.99.5) and 3.100. To avoid subjective assessments (my hearing capacity, the player, the headphones…) I have carried out an objective test: I have imported and exported the same file five consecutive times using the two encoders (with the old computer version 3.98.2 and with the new 3,100) at 96, 128 and 160kbps so that the loss of quality is multiplied by five and the results can be compared objectively.

At any of the three resolutions, the file deteriorates more with LAME 3100. In addition, the loss of quality is not of the same type, it does not have the same texture. Using LAME 3.98.2, the audio obtained after the five re-encodes reminds me of the quality of an old telephone line: music loses brightness and treble. Instead, using LAME 3100 the result reminds me of the quality of a worn and wrinkled cassette tape: the audio is clearly flawed by the amount of artifacts it contains.

I don’t know why there is this difference in results between one version and another, but anyone who tests importing and exporting the same file several times with both versions and comparing the results will confirm what I say.

It wasn’t intended as a joke. It’s a fact that you can “learn” how to hear MP3 artefacts. Some people (not me) are extremely good at it, but not without practice.


Excellent idea.


Very interesting.


Neither do I. Unfortunately it’s difficult for me to test as I’m on Linux, and Audacity uses the system version of LAME, so I can’t easily switch between versions.

As I wrote previously, I don’t see anything in recent changes to LAME that would account for the difference, but there have been a lot of changes in Audacity. One of the recent changes in Audacity is that it now uses a different MP3 importer. (LAME is used only for “exporting”). I wonder if that’s what’s different.

five re-encodes

How exactly are you doing that? Do you:

  1. Export “mp3-1” from Audacity
  2. Import “mp3-1” into Audacity
  3. Export “mp3-2” from Audacity
  4. Import “mp3-2” into Audacity
  5. Import “mp2-5” into Audacity

I’ve done some tests, and (surprisingly), if I import a 128 kbps CBR MP3 into Audacity 3.2.1, the result is very slightly different from importing into Audacity 2.4.2 (my “reference version”).

The biggest difference is that, on Import, Audacity 2.4.2 uses LAME’s “–nogap” metadata, whereas Audacity 3.2.1 doesn’t. This means that Audacity 2.4.2 (correctly) removes the padding at the start of the MP3, whereas Audacity 3.2.1 doesn’t.

There is also an extremely small difference in the spectrogram.
In this screenshot I’ve amplified the difference by 100 dB (100000 times higher amplitude) to make the difference visible:

I’ve logged this as a bug: LAME "--nogap" metadata is ignored · Issue #3778 · audacity/audacity · GitHub

If you really want the best quality you do really need to use an uncompressed format, for example WAV.

For my hi-hi rig (with high quality QUAD electrostatic speakers) I have a hi-fi “jukebox” with a 1TB disk - my CD collection is ripped there as WAV and when I converted my LPs and tapes I also exported to WAVs for use on the hi-fi.

I did also convert these to 256 kbps AAC and MP3 files for use on my iPod and mobile phone when I am travelling or on dive boats well out of the reach of any cloud services. The compressed format is important there as the largest iPod ever available was limited to 160GB - so nowhere near big enough for all my WAV files.

So unless you are making files for portable devices where compressed files may still be an important factor then, given the comparative cheap price od disks these days then WAV (or some other uncompressed format) is really the way to go if you are concerned about the best sound quality.

Peter.

Exactly, that is what the test has consisted of, so that the changes are amplified five times and can be clearly and objectively appreciated.

Well, I have carried out two more tests that, to my knowledge, answer your question in the affirmative.

I have re-encoded the same file five times following the above procedure, but using one version of Audacity to import it and the other to export it. I explain it in detail.

In the first test, I imported the file with Audacity 2.0.3 and saved it as a project (.aup file), then opened it with Audacity 3.1.3 and exported it as .mp3 at 128kbps (with LAME 3.100). I have repeated the operation five times.

In the second test, I imported the file with Audacity 3.1.3 and exported it as .WAV format so I could open it with Audacity 2.0.3, and then exported it as .mp3 at 128kbps (with LAME 3.98.2). I have also repeated the operation five times.

The result is as follows:

First test: the final file imported with Audacity 2.0.3 and exported with LAME 3.100 (Audacity 3.1.3) sounds the same as the final file imported with Audacity 2.0.3 and exported with LAME 3.98.2 (Audacity 2.0.3). The sound resembles that of an old telephone line.

Second test: the final file imported with Audacity 3.1.3 and exported with LAME 3.98.2 (Audacity 2.0.3) sounds the same as the final file imported with Audacity 3.1.3 and exported with LAME 3.100 (Audacity 3.1.3). The sound resembles that of a worn and wrinkled cassette tape.

It seems clear, then, that the difference is not in the version of LAME used when exporting the file, but in the version of Audacity used when importing it. To my knowledge, this does not show that Audacity 3.1.3 imports .mp3 files with poorer quality, but it does show that the sum of the processes of importing and exporting .mp3 files at 128kbps gives better results in Audacity 2.0.3 than in Audacity 3.1.3.

I’ve done some test in which all conditions were identical except for the version of LAME.
All tests done using 128 kbps CBR, 44100 kHz.
Blue = better
Red = worse
The observations below are all measurable (not relying on subjective opinion).

3.98.2
Frequency response up to 19 kHz
Very slightly less post-sound ringing
More pre-echo


3.100
Frequency response up to 20 kHz
Very slightly more post-sound ringing
Less pre-echo

I was surprised that there was any difference, but then checking on https://hydrogenaud.io I found some posts indicating that there had been a slight change in the low-pass filter settings around version 3.98.4/5

There’s a tradeoff, but overall, I think LAME 3.100 gives slightly better results when encoding at 128 kbps CBR.
Of course, 128 kbps CBR is relatively low quality by today’'s standards. The recommended “Preset Standard” gives much better quality, and of course we should always try to avoid multiple-re-encoding with any lossy format.

Ok so I thought I’d try testing low bitrate MP3 imported with the old LAME importer and the new LAME importer and audibly compare the results.

Test MP3 is a 64kbps mono MP3 I have from May 2008 that just happens to be in my iTunes library, it happens to be Suicide is Painless from MAS*H

  1. drag a copy of the 64kbps mono MP3to my desktop
  2. launch Audacity 2.4 2
  3. import the test MP3 by dragging it in
  4. Export as a 32-bit WAV to my desktop, naming it OLD LAME import.wav
  5. Close Audacity 2.4.2
  6. launch Audacity 3.2.1
  7. import the test MP3 by dragging it in
  8. Export as a 32-bit WAV to my desktop, naming it NEW LAME import.wav
  9. Close Audacity 3.2.1
  10. launch 3.2.1
  11. import the OLD LAME import.wav (uses new LAME importer)
  12. import the NEW LAME import.wav (uses new LAME importer)
  13. Press Play
  14. toggle between the two tracks using the Solo buttons in the TCPs
  15. Observe: I can’t for the life of me hear a darn bit of difference between the two tracks - but they both sound a tad dull, equally dull, compared with the 256kbps compressed files I use now for portable listening.
    And note carefully that, as I wrote earlier, I use 16-bit WAVs for listening on my hi-fi rig to get really good, indeed excellent, quality.

Listening was via my hi-fi Bowers&Wilkins P3 Series 2 headphones wire connected via my Edirol UA-1EX external USB soundcard (higher quality than the onboard Realtek card). BTW these are the cans I use for portable listening on my iPods and phone.

I haven’t got the time or the energy, nor the inclination, to repeat the tests with multi-MP3 re-encodes at low bitrate working with old and new Audacity versions, sorry.

Update
I also tried auditioning the two tracks with my studio cans - Sennheiser HD25-1. Same result I can’t hear a difference between the tracks using the old and new LAME importers that Audacity has

Peter.

It looks like 3.1.3 correctly removes the padding.

– Bill

Yes. It looks like this commit is responsible: MP3 import based on libmpg123 by crsib · Pull Request #3079 · audacity/audacity · GitHub

The good news is that (from Google search of Lame’s Dev mailing list) it appears that libmpg123 has supported the --nogap tag since at least 2011, so the issue should be fixable with the current decoding library.

I see on your github report here: Issues · audacity/audacity · GitHub

Ryan-Miller-Audacity added this to the Audacity 3.3 milestone yesterday