News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MP3 tag reader

Started by donkey, January 05, 2009, 03:34:28 AM

Previous topic - Next topic

donkey

I have been working on an MP3 tag reader that can read information from an MP3 file. The goal is to use it as a jumping off point for an MP3 player based on the MAD decoder but that is a ways off. For now I would like to know if the tags are being properly read. The attached program should be able to read ID3V1,V2,V3 and V4 tags as well as faithfully interpret the audio header for both fixed bitrate and VBR files. It should be able to display any valid image type in V2,3 & 4 tags (V1 has no attached image). I am especially interested in how it handles images from V2, I have only a few V2 files and they all seem to work OK but a wider test is called for since I only have a single program that can write V2 tags. The software should run on 98SE/ME/2K/XP, it may run on Vista but I don't have a Vista machine to test it on. You will need to have gdiplus.dll in the same folder as the executable, I used 5.1.3097.0 but any version should do, the dll is available at MSDN:

http://www.microsoft.com/downloads/details.aspx?FamilyId=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en

Executable and source are included in the zip, if you download it at least make a comment, it's frustrating to see 20 or 30 downloads and no comments on the code.

[attachment deleted by admin]
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ecube



looks good, nice work

also I just tested it in on vista home premium in vmware and it worked fine,and didn't need gdiplus.dll in the same folder.

donkey

Thanks E^cube

BTW I guess I should mention that the bitrate for VBR is the average bitrate through the entire MP3 and the length is the play time in milliseconds, I never bothered to convert it to minutes/seconds since it's only a test platform. Here's a V4 screenshot with album art:

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

Quote from: E^cube on January 05, 2009, 04:51:54 AM
and didn't need gdiplus.dll in the same folder.

Hi E^cube.

You are likely using XP which generally has the version I posted natively, however when using older OS versions MS says it should be placed in the application folder...

Quote from: MSDNNoteĀ  If you are redistributing GDI+ to a downlevel platform or a platform that does not ship with that version of GDI+ natively, install Gdiplus.dll in your application directory. This puts it in your address space, but you should use the linker's /BASE option to rebase the Gdiplus.dll to prevent address space conflict.

By the way there is a problem in the software with the audio header read section, when an MP3 has incorrect ID3 header size information and there is a false sync (0xFF,0xFx) encountered it can lead to errors in decoding and in one particular combination of false flags the app will crash. I am working on a solution.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Neil

Works perfectly on my PC running Vista Home premium & on my wifes laptop running Vista Home Basic :U
Didn't need the dll

JayPee

Hi Edger

Downloaded your tagreader, works great for me. Hope you don't mind, i used your read mp3 header code in a mp3 player that I am working on as learning project.

Regards
John
Greetings From New Zealand
(Land of the Long White Cloud)

donkey

Hi JayPee,

No problem at all, you can use any of my code for anything you like (though I do ask that it not be used in GPL applications). If you make any changes or fix any bugs post it here so everyone can gain from your work.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Siekmanski

Hello Donkey

I'm writing some MP3 code at this time as well.
It's an attempt to make a FM MPX signal in software so that I can transmit in Stereo with RDS on a simple Mono FM transmitter ( coding still in progress )
I would like to share some info that I came across in some mp3 files with other header tags.
At offset 36 of the "MPEG Audio Frame Header" besides the "Xing" tag I found 2 other tags:

"Info" frames at offset 44 of the MP3-header (same as Xing)
"VBRI" frames at offset 50 of the MP3-header

I couldn't load MPEG Version 2.5 files with your program

I also check for MPEG Version 2.5 ( the Fraunhofer ACM codec supports it )
(bit 20-19)
MPEG Audio version ID
00 - MPEG Version 2.5
01 - reserved
10 - MPEG Version 2
11 - MPEG Version 1

Siekmanski



donkey

Hi Siekmanski,

Thanks for the bug report. I'm afraid my coding time has run out for now, I will be working pretty much non stop for the next month at the very least so I will not have the time to do any corrections. I will return home sometime in June and will try to take a look at it then. Until June I am pretty much stuck with Hotel PCs and my iPaq for any personal use...

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable