mp3 sounds distorted after imported to audacity

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
one_quick_question
Posts: 7
Joined: Wed Feb 03, 2021 5:35 pm
Operating System: Windows 10

mp3 sounds distorted after imported to audacity

Post by one_quick_question » Wed Feb 03, 2021 5:45 pm

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).
Attachments
test.mp3
(55.08 KiB) Downloaded 31 times

DVDdoug
Forum Crew
Posts: 9416
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by DVDdoug » Wed Feb 03, 2021 6:30 pm

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 Kabuu Audio Converter or TAudioConverter. 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 making Audacity use FFmpeg 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 MP3Diags 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.

one_quick_question
Posts: 7
Joined: Wed Feb 03, 2021 5:35 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by one_quick_question » Wed Feb 03, 2021 11:00 pm

DVDdoug wrote:
Wed Feb 03, 2021 6:30 pm
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 Kabuu Audio Converter or TAudioConverter. 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 making Audacity use FFmpeg 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 MP3Diags 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.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: mp3 sounds distorted after imported to audacity

Post by steve » Thu Feb 04, 2021 6:34 pm

one_quick_question wrote:
Wed Feb 03, 2021 5:45 pm
(I attached one of the files which sound distorted).
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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

one_quick_question
Posts: 7
Joined: Wed Feb 03, 2021 5:35 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by one_quick_question » Sat Feb 06, 2021 6:59 pm

DVDdoug wrote:
Wed Feb 03, 2021 6:30 pm
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 Kabuu Audio Converter or TAudioConverter. 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 making Audacity use FFmpeg 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 MP3Diags 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.
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 :(

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

one_quick_question
Posts: 7
Joined: Wed Feb 03, 2021 5:35 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by one_quick_question » Sat Feb 06, 2021 7:12 pm

steve wrote:
Thu Feb 04, 2021 6:34 pm
one_quick_question wrote:
Wed Feb 03, 2021 5:45 pm
(I attached one of the files which sound distorted).
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.
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. :(
Attachments
obs_studio_output.mp3
(269.8 KiB) Downloaded 9 times

DVDdoug
Forum Crew
Posts: 9416
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by DVDdoug » Sat Feb 06, 2021 7:31 pm

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).

one_quick_question
Posts: 7
Joined: Wed Feb 03, 2021 5:35 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by one_quick_question » Sat Feb 06, 2021 9:42 pm

DVDdoug wrote:
Sat Feb 06, 2021 7:31 pm
Sorry, what?
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 :) I'm quite new to audio file formats so I really appreciate all the ideas!!

jademan
Forum Crew
Posts: 1415
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by jademan » Sun Feb 07, 2021 4:53 pm

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
Trackpanel000.png (16.26 KiB) Viewed 416 times
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. :D

DVDdoug
Forum Crew
Posts: 9416
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: mp3 sounds distorted after imported to audacity

Post by DVDdoug » Sun Feb 07, 2021 5:57 pm

I think I found a fix with MP3Gain !

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.
MP3directCut can also normalize without decoding/decompressing. After selecting Normalize, check the box that says "Check For Overdrive",

Post Reply