View Full Version : Determine .mp3 length (time) with PHP?

03-16-2008, 09:28 PM

I'm creating an RSS feed using PHP and I've added all of the XML tags necessary except for the <itunes:duration> tag, which is necessary for submission to iTunes.

I used PHP's filesize() function to determine each enclosure's file size, but I'm wondering if there is any PHP function, or perhaps a method of combining PHP with another language, that would determine the playtime of a particular file. I'm also wondering if there are any such methods for other file types, like .mov or .swf.

Just looking to be pointed in the right direction, I'm not sure where to start.


03-16-2008, 09:59 PM
You could try this project (http://getid3.org/).

03-16-2008, 10:09 PM
Wow. That's extremely helpful, exactly what I needed. Thanks!