Reading data from an MP3

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deanengland
Forum Newbie
Posts: 2
Joined: Tue Jan 23, 2007 8:23 am

Reading data from an MP3

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Take a look at getid3. If memory serves, it can extract that simple information fairly easily and quickly.
deanengland
Forum Newbie
Posts: 2
Joined: Tue Jan 23, 2007 8:23 am

Post by deanengland »

Thanks Feyd... I'll give it a go.
Post Reply