LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to obtaining mp3 header

I'm having trouble getting the mp3 header!
I'm using the same properties as reading wave file, but i'm getting gibberish, why is that?
0 Kudos
Message 1 of 14
(4,492 Views)

Well, I'm not an expert on this, but this is probably because these are two wildly different formats - wave is very old and is simply a digital representation of the sound wave. MP3 is much newer and compresses the file, giving much smaller file sizes.

In this case, what do you mean by "header"? Are you looking for content information? If you are, you can read the last 128 bytes of the file, which make up the ID3 tag. It's plain ASCII and it's well documented on the internet.

Are you currently using the sound VIs to read the file? How about using media player's ActiveX interface (if you're using windows)?


___________________
Try to take over the world!
0 Kudos
Message 2 of 14
(4,487 Views)

I'm creating a database for mp3s and i'm trying to get the header data (not ID3) of each mp3s, and I don't want to use activex.

Does anybody know how to go about it? 

0 Kudos
Message 3 of 14
(4,482 Views)
Hello celiowin,

what do you mean with header? What information do you want to retrieve?

My mp3s all start with $FF $FB (hex) and after that they have different content, depending on codec...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 14
(4,477 Views)
Like I said, I'm not an expert on this, but a quick google search for "mp3 header" shows (at least as a possibility) that there is no header to the file, only to each specific frame, and also gives links for description of the mp3 format and for source code in C for how to read those headers.
It's still not clear what your level is, because you say you tried to use the same properties you used for wave files, so - do you know the mp3 details and how do you read waves? Is your problem a LV implementation problem or a basic problem with reading mp3 data?

___________________
Try to take over the world!
0 Kudos
Message 5 of 14
(4,475 Views)
The type of infromation i'm trying to get is the type of mpeg layer, sampling rate frequency, and channel mode.
I know these information is in binary but i'm having troble getting them, I keep getting the tag becasuse it is ASCII and getting nowhere.
0 Kudos
Message 6 of 14
(4,472 Views)

I've read information on mp3 and its anatomy. If i'm able to get the first header of the first frame, i'm able to count the number of frames and extract information from the header of the first frame and use it my database.

with mp3 source code they use pointers. I'm using labview 7.1.

0 Kudos
Message 7 of 14
(4,471 Views)

I had a quick read of this page, and made the following VI as an example for how to turn the header into a boolean array, which you can now analyze.

If I understand correctly, you will still need to find the header, because there is no gurantee that it will be at the beginning of the file. I'm sure you can convert the entire file into a boolean array and look for 11 elements in a row, but that would probably be inefficient and inaccurate. Also, I'm fairly sure that there are better ways to get the bit array using the VIs in the Advanced>>Data Manipulation palette.

Does this help? Do you know which technique is used to find the headers?

___________________
Try to take over the world!
0 Kudos
Message 8 of 14
(4,443 Views)

Hi tst,

I've opened through one whole and displayed it in a string indicator, but it looks exactly the same as viewing mp3 through word pad.

How could I compare for 11111111111, if i can't check it if its right.

 

0 Kudos
Message 9 of 14
(4,427 Views)
Hello celiowin,

you need to convert the mp3-data to array of bits to find the 11x1. (First convert string to U8-array, then convert U8-array to boolean array, byte by byte).
But keep in mind: converting a "normal" mp3 of about 4MB to boolean array needs about 4*1024*1024*8*1 = 32 MB of memory for the boolean array (Labview stores bits in 8bit values).


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(4,415 Views)