Page 1 of 2

Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 3:39 am
by Ricardo
Hello, world!

First of all, I want to thank all the Audacity team and everyone that helps to make Audacity such a great open source software!

And now, to my bug report. From time to time I found a MP3 file that Audacity can't import correctly: a stereo file is imported as mono and/or the sample rate is wrong (48kHz instead of 44kHz).

I don't think the problem is in the MP3 files themselves since I can open and play them without problems on several softwares and platforms, like Windows Media Player, VLC, Quicktime, RealPlayer, Wavosaur, and even on my Palm TX.

Here are the details of my system:

Audacity 1.3.7 and 1.3.6 (IIRC, some older versions also had this problem)
Windows XP SP3
2GB RAM

Here are the details of one of the MP3 files with problems:

Duration...........: 00:04:03
Bit Rate............: 192kbps
Channels...........: 2 (stereo)
Audio sample rate: 44 kHz

The file above is imported as Mono, 48,000Hz by Audacity. It plays in Audacity just like that: it has just the left channel from the source, with a duration of 03:44 (instead of 04:03), due to the difference in the sample rate.

I tried this with Audacity before and after installing the FFmpeg Import/Export Library from this link:
http://www.audacityteam.org/manual/inde ... tallffmpeg

I also searched the forum but couldn't find anyone reporting a similar problem...

I'd be glad to help fix this bug by testing patches, providing more information and even files with problems.

Alternatively, I'd also like suggestions of audio players and editors with waveform display that can be used to seek / jump to parts of the audio file. Audacity is, for my needs, almost perfect for this.

(Obs: I edited the title of this post when I found out the source of the problem)

Re: Audacity importing MP3 with wrong format (v. 1.3.7)

Posted: Sat Mar 21, 2009 3:59 am
by kozikowski
<<<I also searched the forum but couldn't find anyone reporting a similar problem...>>>

Which is why this probably isn't a bug. It's a bug when you show up with 100 of your closest friends and you all have the same problem.

Do you have Windows set to show you file extensions? I don't remember the complete spell, but it's something like My Computer > Properties > View > Uncheck [Hide File Extensions of known file types.]. Then ripple the change to the whole computer. Hiding file extensions was one of the most grievous things that Microsoft did and it causes enormous problems.

Do you still have as many .mp3 files as you thought, or did some of them turn out to be Something Else that Audacity may not recognize, like mymusic.mp4, mymusic.m4a mymusic.wma?

Koz

Re: Audacity importing MP3 with wrong format (v. 1.3.7)

Posted: Sat Mar 21, 2009 4:54 am
by Ricardo
Hi Koz!

Thanks for replying.
kozikowski wrote:<<<I also searched the forum but couldn't find anyone reporting a similar problem...>>>

Which is why this probably isn't a bug.
Not all bugs are popular, and for every bug there's always a first report. Also, I'm the kind of user that finds bugs in the least expected places... ;-)
kozikowski wrote:Do you still have as many .mp3 files as you thought, or did some of them turn out to be Something Else that Audacity may not recognize, like mymusic.mp4, mymusic.m4a mymusic.wma?
I understand your point: most of the time, the bug is not in the software - it's the user. :-) But this is not the case. The files in question are real MP3s.

I was not complaining about Audacity not recognizing the files. Even if Audacity didn't recognize the file and tried to import it as RAW (or any other format), it would probably sound just like garbage... but that's not the case: it doesn't sound as it should (or else I wouldn't be posting here), but sounds like the MP3 was imported, one channel was removed and the sample rate changed from 44kHz to 48kHz. And, most importantly, Audacity shows the dialog "Importing MP3 Files" while loading them.

Just to help you to be sure that I know what I'm talking about, the files I'm having problems with Audacity are MPEG-1 Layer 3, 44100Hz, 192 kb/s, Joint Stereo. They have ID3V1 & ID3v2.3 tags. And ".MP3" file extensions. It's not just me, but several programs can attest this.

Note: I have several files with these characteristics (44100Hz, 192 kb/s, Joint Stereo, ID3 tags), but only a few have problems when imported in Audacity.

Re: Audacity importing MP3 with wrong format (v. 1.3.7)

Posted: Sat Mar 21, 2009 4:58 am
by Ricardo
I guess I just found out where the bug lies...

I removed the ID3 tags and the MP3 file was correctly imported! :D

I still have the original file if someone from Audacity team wants to check it out, just let me know and I'll send you one.

Re: Audacity importing MP3 with wrong format (v. 1.3.7)

Posted: Sat Mar 21, 2009 5:32 am
by Ricardo
To help to identify the problem more accurately, I tried a couple of things with Mp3tag (v2.42b). I tested 3 files with the problem, and when I removed just the "extended tags" from those MP3s, Audacity imported them just fine! So, the problem doesn't seem to be with the ID3 tags, but only the "extended tags" (whatever that means). Unfortunately (?), I also have files with basically the same "extended tags" that Audacity import without problems, and I couldn't find anything else that could shed some new light.

Anyway, it's past bedtime here, see you later!

Re: Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 2:37 pm
by Ricardo
It seems that Audacity reads the ID3v2 tags as part of the audio data. There's a characteristic audio glitch at the beginning of the problematic MP3s when they are played in Audacity. Every time I remove the ID3v2 tags the file is imported correctly... when I add an ID3v2 tags back to the file, the problem appears again.

As I stated before, most files with ID3v2 tags are imported correctly, only some of them have problems.

Re: Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 3:57 pm
by steve
Have the problem files come from one particular application? I've heard of people having problems with files created by Adobe Premiere Elements due to non-standard data that Premiere added to the files. I'm wondering if this is something similar.

Of course a simple workaround would be to decompress the files before importing into Audacity, or as you are doing, removing the problem tags, but it would be much better to get to the root of the problem. If you are able to isolate exactly what causes the problem then I think it will be time to pass the issue over to the Audacity developers.

Re: Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 4:58 pm
by Ricardo
stevethefiddle wrote:Have the problem files come from one particular application?
IIRC, I used Media Player to convert some CD tracks to MP3 and used Mp3tag to add the tags. The odd thing is that all files have ID3v1 and ID3v2 tags, with basically the same contents, but just a few have problems - and the problems appear only in Audacity, all other players and editors have no problems at all with the files. It's an Audacity bug.
stevethefiddle wrote:If you are able to isolate exactly what causes the problem then I think it will be time to pass the issue over to the Audacity developers.
I had already sent an e-mail to the Audacity team pointing to this thread, with a problematic MP3 attached.

Re: Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 6:53 pm
by Gale Andrews
Ricardo wrote:I had already sent an e-mail to the Audacity team pointing to this thread, with a problematic MP3 attached.
Thanks for contacting our feedback address, Ricardo, which is the correct way to report possible bugs.

First of all, the problem is probably with the third party LIBMAD library which is used by default for MP3 decoding. If you install the optional FFmpeg library which you mentioned and then use FFmpeg rather than LIBMAD to import the problem file, it is read correctly. To force FFmpeg to import the file rather than LIBMAD, you have to click File > Import > Audio and select "FFmpeg-compatible files" in the "Files of type" dropdown. After that you can drag the files in if you prefer and the FFmpeg library will be used to import them.

So, that is the better workaround (in 1.3.7) than deleting the tags. It's disappointing this seems to have regressed, because 1.2.6 imports this file fine. The problem is not with "extended" tags as MP3Tag calls them (that just seems to be a window where you can add custom tags, and there aren't any custom tags in this file). The actual problem is that MP3Tag is adding CD TOC information, that is an MCDI "Music CD identifier" frame and the required corresponding TRCK frame, without apparently giving you any option not to do so.

These frames are what are causing the decoding error in LIBMAD. Removing all the tags using MP3Tag also removes these frames and lets the file import properly, but removing the tags created by MP3Tag with other tag editors does not remove these two frames, and so the file then still imports incorrectly.

We have a number of other files reported to us which (using LIBMAD), import at wrong sample rates or mono instead of stereo, but which don't have a click at the start. Now we have a possible clue, I'll see if these have CD TOC data and if this is actually the problem. Then we can look into the best way of resolving this.

Thanks


Gale

Re: Audacity bug importing MP3 with "Extended Tags" (ID3v2)

Posted: Sat Mar 21, 2009 7:55 pm
by Ricardo
Hi Gale!
Gale Andrews wrote:To force FFmpeg to import the file rather than LIBMAD, you have to click File > Import > Audio and select "FFmpeg-compatible files" in the "Files of type" dropdown. After that you can drag the files in if you prefer and the FFmpeg library will be used to import them.
Thanks for the tip! Hmm... that was a tricky one. I'd suggest that this information be included in the download page, because one has the impression that just installing the FFmpeg libs would automatically enable them.
Gale Andrews wrote:We have a number of other files reported to us which (using LIBMAD), import at wrong sample rates or mono instead of stereo, but which don't have a click at the start. Now we have a possible clue, I'll see if these have CD TOC data and if this is actually the problem. Then we can look into the best way of resolving this.
Thanks for the insight and for such fast and great reply, couldn't wish for anything better! :-)