IPB

Welcome Guest ( Log In | Register )

Parsing the MP3 Data, Isolating the MP3 Data Only
samokan
post Dec 16 2011, 06:57
Post #1





Group: Members
Posts: 8
Joined: 16-December 11
Member No.: 95828



Hello Everyone.

I am still a newbie when it comes to MP3 and its detail/internal structure.

This past few days, I have been parsing different MP3 files most of which have ID3vxx format. So basically to get the Mp3 data, I just read the data after the tag in case of ID3v2 and before the tag in case of ID3v1.

So now I am given a Lame encoded? MP3 file. I can get the Header Information but not the actual audio data. crying.gif

So basically what I'm trying to do is to get the MP3 header and MP3 data only and ignore any tag/header or info within it.

Thank you for any information.

** I hope I posted this in the correct area smile.gif
Go to the top of the page
+Quote Post
 
Start new topic
Replies
mjb2006
post Dec 16 2011, 08:19
Post #2





Group: Members
Posts: 848
Joined: 12-May 06
From: Colorado, USA
Member No.: 30694



Is http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx any help?
Go to the top of the page
+Quote Post
samokan
post Dec 16 2011, 09:12
Post #3





Group: Members
Posts: 8
Joined: 16-December 11
Member No.: 95828



QUOTE (mjb2006 @ Dec 16 2011, 16:19) *


Thank you for that sample code. Besides the VBR/Xing Headers area, my code basically has the same concepts.
I dump the HEX value of the mp3 file and there is no "Xing", "Info".

One file have the LAME3.94 Version somewhere at the bottom of the file and the on the other file it is scattered all over the file.
So basically I need to know the starting point of the audio stream and how big it is so that I can read it from the file and copy it to the memory and give it to the decoder .. crying.gif

Go to the top of the page
+Quote Post
alexeysp
post Dec 16 2011, 13:20
Post #4





Group: Members
Posts: 141
Joined: 3-April 09
Member No.: 68627



QUOTE (samokan @ Dec 16 2011, 11:12) *
So basically I need to know the starting point of the audio stream and how big it is so that I can read it from the file and copy it to the memory and give it to the decoder .. crying.gif


To find the start of the actual audio stream you have to skip the ID3v2 tag if it is present, using the tag size field from the tag itself, and then start scanning the stream for a valid mp3 frame header, which always starts from the 11 bits all set to one. Then parse the header to verify that this is actually a valid frame and find out its size.

If the first frame of the stream does not contain VBR ("Xing" or "Info") header, then there is no way to find out the length of the entire stream except to parse it frame-by-frame until there are no more data to process.

Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th November 2014 - 11:23