mp3 sounds distorted after imported to audacity

Hello,

I’m using audacity 2.4.2 on windows 10.
I am batch editing (Makros) a couple of mp3 files.

However i noticed a problem with some of them.
When i play them in audacity (before editing them) they sound heavily “distorted”.
However there is no distortion when i play the file with VLC/Itunes/Windows Media player.

After I export the file in audacity as another mp3, it also sounds distorted in VLC/etc…

My guess is that there is a problem with the import of the mp3 into audacity, but I am quite clueless…
I already tried resetting my audacity settings, but it didn’t help.

Please note, that I only get this problem with some of the mp3s while most of them work perfectly fine.

Any help is highly appreciated!
Thanks!

(I attached one of the files which sound distorted).

I’d guess there is some corruption or something non-standard about the original MP3 file. Depending on the decoder some software may ignore or get-around the problem…

You can try converting the file to WAV or FLAC before opening in Audacity. Try [u]Kabuu Audio Converter[/u] or [u]TAudioConverter[/u]. Most of these free tools use the same FFmpeg encoders/decoders as VLC so there’s a good chance that will work. VLC should also be able to do it but you’ll have to look-up how.

There is also a way of [u]making Audacity use FFmpeg[/u] and that might be worth a try.

Is the original file available online so we can look at and “play with” it? (Your attached file seems “technically OK” except for the audio distortion).

I have a tool called [u]MP3Diags[/u] that can diagnose, and often fix MP3s and you can experiment with that if you want. But it’s complicated with lots of information and lots of options and I usually end-up just blindly trying some of the repair options.

Thanks!
I got a collection of mp3 files from my university, which contain spoken arabic words such as this one.
So unfortunatly it is not available online, but this is the original - unmodified, uncut (by me) - file which i received. (i have roughly 900 of them). so if you want feel free to “play” with this file.

Thanks for your tips, i will look into them and post here if i find a solution!

Unfortunatly vlc doesn’t seem like an option to me, since i got 900 small mp3s and never heard of batch converting in vlc.

I tried playing that in VLC and it sounds horribly distorted.
I also tried in a couple of other apps - same result: horribly distorted. I don’t think that can be fixed.

So here are my results:

I had some success using TAudioCnverter and converting to .wav. However the sufficient improvement in quality of the heavily distorted files stood in contrast to the decline in quality of the good quality mp3s. So unfortunately overall it’s not an option for me.

I tried using the MP3Diags tool but it didn’t help :frowning:

Converting with VLC also resulted in distorted files, unless exported as raw. However when importing the raw file into audacity it was distorted again.

Well i can testify, that it works perfectly fine with my vlc 3.0.12 on windows 10.

Prove/demo: I recorded myself first playing the file with vlc and afterwards with audacity using OBS Studio. (output saved as .mkv)
In order to upload it here i then converted the .mkv output to .mp3 using VLC. (result is attached)

Obviously i can’t use this workaround to fix my problem with 900 files. :frowning:

We just have to guess since we don’t have the original file…

However the sufficient improvement in quality of the heavily distorted files stood in contrast to the decline in quality of the good quality mp3s.

Sorry, what?

Converting with VLC also resulted in distorted files, unless exported as raw. However when importing the raw file into audacity it was distorted again.

That’s weird. The only difference between a raw PCM file and a regular WAV file (with the same settings) is that the WAV file has a header so the the software knows the bit depth and sample rate, etc. With a raw file you have to know or you have to guess.

Try converting to floating-point WAV. Floating-point can go over 0dB without clipping (distorting). Regular (integer WAV files are hard-limited to 0dB). MP3 can also go over 0dB so maybe that’s the problem… Maybe it’s not any kind of corruption… Maybe it’s just “too loud”.

Then after opening the floating-point WAV in Audacity, run the Amplify effect. Audacity has already pre-scanned your file and if the peaks go over 0dB, Amplify will default to a negative value (attenuation instead of amplification).

What i meant is, that converting to wav fixes the distorted files well enough, but it also decreases the quality of the non-distorted files.
And taking that into account, just converting all files, would have too much negative impact compared to the advantages.

That’s weird. The only difference between a raw PCM file and a regular WAV file (with the same settings) is that the WAV file has a header so the the software knows the bit depth and sample rate, etc. With a raw file you have to know or you have to guess.

Try converting to floating-point WAV. Floating-point can go over 0dB without clipping (distorting). Regular (integer WAV files are hard-limited to 0dB). MP3 can also go over 0dB so maybe that’s the problem… Maybe it’s not any kind of corruption… Maybe it’s just “too loud”.

Then after opening the floating-point WAV in Audacity, run the > Amplify > effect. Audacity has already pre-scanned your file and if the peaks go over 0dB, Amplify will default to a negative value (attenuation instead of amplification).

Thanks i will try that :slight_smile: I’m quite new to audio file formats so I really appreciate all the ideas!!

FWIW, I thought I would take a look at this.

I tried loading and playing test.mp3 in Audacity and in VLC. There is significant overmodulation in Audacity. When the Audio is loaded into Audacity (drag-and-drop), the Amplify effect uses -18.051 to bring it down to full scale - go figure! When I look closely at the peaks, there is apparent damage, but they are not flat as I might have suspected. And upon playing, the audio still sounds heavily damaged.

However, when I played test.mp3 in VLC 3.0.12 (windows), the audio played clearly and there was no distortion whatsoever.

I tried DVDdoug’s suggestions:
FFmpeg import into Audacity: audio is heavily clipped at 1.0 as one might expect, so unlike Audacity import, no change with Amplify effect. Curiously, audio “sounds” much closer to VLC than to Audacity’s import, but sound seems bassier and muddled.

Tried Kabuu Audio Converter: this was identical to FFmpeg’s import. The only difference was dither. inverted this track, then mixed it with the FFmpeg track and found only about -90dB signal remaining.

Tried TAudioConverter: I had an installation error (BASS.dll not found) (both 32-bit and 64-bit versions).

So curiously, I tried playing the mp3 file via VLC and recording with Audacity. Here is what I saw:
Trackpanel000.png
Top = VLC, Bottom = FFmpeg. Note that the VLC curve does not clip. So it appears that VLC has some “magic” code the others do not have that fixes the problem.

:ugeek: ===================================== :ugeek:

MP3Diags (unstable) 1.501 reported:

====>MP3GAIN_MINMAX=“122,238”, MP3GAIN_UNDO=“-028,-028,N”, REPLAYGAIN_TRACK_GAIN=“-5.330000 dB”, REPLAYGAIN_TRACK_PEAK=“6.618240”<=====

*No ID3V2.3.0 tag found, although this is the most popular tag for storing song information.

*ID3V2 tag doesn’t have an APIC frame (which is used to store images).
:padding=0, unsynch=no; frames: TSSE=“Lavf54.20.4”

:MPEG-1 Layer III, Stereo, 44100Hz, 48000bps, CRC=no; [Xing header info: frame count=134, byte count=56162, TOC present]

*Low quality MPEG audio stream. (What is considered “low quality” can be changed in the configuration dialog, under “Quality thresholds”.)
:0:03, MPEG-1 Layer III, Joint stereo, 44100Hz, 128000bps CBR, CRC=no, frame count=134; last frame located at 0xd9e1
:ugeek: ===================================== :ugeek:

VLC has some “magic” code the others do not have that fixes the problem. Keep smiling. :smiley:

I think I found a fix with [u]MP3Gain[/u] !

Make a backup because MP3Gain changes the actual selected file.

Under options select Don’t Clip.
Then select Modify Gain and Apply Track Gain.

It looks like the only problem is that it goes over 0dB and most decoders are clipping or distorting when you open or convert the file. Apparently, VLC can decode without clipping and it looks like VLC is also automatically normalizing the file (bringing down the volume for 0dB peaks).

MP3Gain changes the level without decoding.

P.S.
[u]MP3directCut[/u] can also normalize without decoding/decompressing. After selecting Normalize, check the box that says “Check For Overdrive”,

Congratulations!

I couldn’t get MP3Gain to install the first time, so I tried installing MP3DirectCut. But the most recent version 2.32 has had its Overdrive check removed. I guess they were having problems with it. So I downloaded the 2.30 version from here: https://mp3directcut.en.uptodown.com/windows/versions
Trackpanel002.png
Here are the waveforms:

From top to bottom left channel shown:

  1. Audacity import
  2. Audacity import amplified by -18
  3. VLC recorded via stereo mix
  4. Audacity/FFmpeg import
  5. From MP3DirectCut 2.30 Normalize+Overdrive Check

Congratulations!

I couldn’t get MP3Gain to install the first time, so I tried installing MP3DirectCut. But the most recent version 2.32 has had its Overdrive check removed. I guess they were having problems with it. So I downloaded the 2.30 version from here: https://mp3directcut.en.uptodown.com/windows/versions

Here are the waveforms:
Trackpanel002.png
From top to bottom left channel shown:

  1. Audacity import
  2. Audacity import amplified by -18
  3. VLC recorded via stereo mix
  4. Audacity/FFmpeg import
  5. From MP3DirectCut 2.30 Normalize+Overdrive Check

We have a winner! :smiley:

Another fix using VLC from the command line:

cvlc "test.mp3" --no-sout-video --sout-audio --sout "#transcode{acodec=fl32 channels=1}:std{access=file,mux=wav,dst=test.wav}"

The resulting file is 32-bit float and peaks at +16.415 dB (which is why it sounds so distorted with most decoders).
After normalizing in Audacity to 0 dB, this is the result:

(The command line example was for Linux. The exact command may be slightly different on other platforms - I just followed VLC’s documentation.)

Thanks a lot for your analysis!!!
Somehow I didn’t think about analyzing the recorde vlc ouput in audacity. And I seem to have missed the MP3Diag tool gain part (tbh the whole thing seems a bit confusing to me)

Thanks a lot!
My solution: I ended up converting all of the files with vlc to mp3, but applying the normalize volume audio filter.
Tbh i i didn’t think I had enough knowledge of audio to set all those parameters correctly and use the command line.

Also thanks to you!!!

I wish I had seen this before doing my vlc fix.
Since the vlc gui doesn’t allow you to specify a destination folder when converting multiple files, I had to use some options which adds “–converted” in the file name. Removing this string again in windows actually required me to write a PowerShell one liner using regex…


So again: Big thanks for your help to you all!!!

Your way is absolutely fine. The only reason I was messing with the command line was because I was curious about what was going on.

My observations and “best guesses” at what’s going on with that file:

  1. The MP3 is faulty. Several of the command line tools reported errors in the file, indicating encoding and metadata errors.

  2. The actual peak level of the audio is +16.415 dB

  3. The file contains ReplayGain metadata, and correctly reports the peak level as 6.6182 (linear) = +16.414850 dB.

  4. Most MP3 decoders appear to decode directly to 16-bit integer, which clips at 0 dB

  5. Audacity’s MP3 importer can handle “over 0 dB” MP3 files, but only up to +10 dB.

  6. VLC (Windows) could play without distortion because it appears to apply ReplayGain peak correction before converting to 16-bit integer.

  7. The VLC decoder is remarkably fault tolerant with MP3 files.

:smiley: You are quite welcome :smiley:

:smiley: Not a problem.
I think we were all more curious as to what was happening. You deserve the accolades yourself for recognizing the discrepency. :smiley:

Hello all,

I use Audacity to play my radio program. I noticed today that two mp3s I dropped into Audacity started sounding distorted.

When I searched online, I came across this thread.

There are around 30 other MP3s in the two-hour long program. None of the other MP3s had an issue. I have been using the older versions of Audacity for years without any such problem.

I then opened another audacity project, dropped the same two MP3s there. There was no problem! Copied the track from this temporary project to the Audacity radio program project, the MP3s immediately got distorted.

I read this thread carefully. However, I think my problem is a bit different, so I decided to consult with you folks as to what to do.

Any suggestions?

Al

I’m using Audacity 3.0.2.
I’m a Windows 10
The MP3 came from a CD that I ripped some years ago.

If you copied into an existing track, check that the “Gain” slider is not set greater than zero (See: https://manual.audacityteam.org/man/audio_tracks.html#gain)