943,866 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2562
  • PHP RSS
Dec 13th, 2008
0

Getting MP3 metadata

Expand Post »
Is there anyway to get metadata of an mp3 file using php? Even just the track length. Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
xarz is offline Offline
24 posts
since Nov 2008
Dec 14th, 2008
0

Re: Getting MP3 metadata

The format of MP3 isn't as difficult as one might think at first time. Information like title, author, album etc are simple string stored at the end of the file. This section always starts with "ID3".
To get the length of the song you need various information. The number of tracks (eg mono, stereo, surround), the frequency used and so on. Then you have to skip through the so called "blocks", read the current compression rate (not all MP3s are encoded with a constant bitrate), add them all together and divide by a quotient of the stuff you found out at the beginning.
Personally, I never did that in PHP, but I used some of these files to figure it out: http://www.wotsit.org/list.asp?page=3&fc=12&search=&al=
It might be quite fuzzy at the beginning, but keep going. Once you understood the basics of MP3, you'll get on very quickly. I think it took me about 3hrs to understand the framework of MP3 - the coding stuff was then about just half an hour.

Greetings Simon
Reputation Points: 56
Solved Threads: 29
Posting Whiz in Training
sDJh is offline Offline
255 posts
since Aug 2005
Dec 14th, 2008
0

Re: Getting MP3 metadata

thanks alot for the link.. i didn't really get what by what you explained but i'll try to understand more about mp3.. maybe i can get some knowledge from it..
Reputation Points: 10
Solved Threads: 1
Newbie Poster
xarz is offline Offline
24 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Explode and Post doesn't seem to work together
Next Thread in PHP Forum Timeline: About Drupal





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC