Page 1 of 1

Reading data from an MP3

Posted: Tue Jan 23, 2007 8:52 am
by deanengland
Hi,

I'm aware that folks have mentioned a number of applications for getting tags from MP3 files in this area before... but my reuqest is somewhat different.

I simply (hopefully) want to get the bitrate of an MP3 file usuing a php function.

I'm relatively new to all this so forgive my naivity.

I've looked at http://www.mp3-tech.org/programmer/frame_header.html which gives very stratightforward info on
the struture of MP3s.. very helpful

If I could red this data, it shold n't be too difficult to lookup the V and L info and then use the appropriate bitrate index to calculate what I need to know.

My problem is accurately reading in the info using php.

The key that things aren't going right is that the parity bits (21-31) are not all set (to 1) in my results.

Is anyone able to read an MP3 and obtain results where bits 21-31 all=1? If so, could you advise me on how to achieve this please?

Kind regards,
Dean

Posted: Tue Jan 23, 2007 8:57 am
by feyd
Take a look at getid3. If memory serves, it can extract that simple information fairly easily and quickly.

Posted: Tue Jan 23, 2007 2:38 pm
by deanengland
Thanks Feyd... I'll give it a go.