Getting just the Duration of an MP3 file

The place for "I can't figure out how to..." questions.
Post Reply
Posts: 1
Joined: Wed Apr 12, 2006 1:35 pm

Getting just the Duration of an MP3 file

Post by dnyer11 » Wed Apr 12, 2006 3:43 pm

Hey everyone, I need some help making a php file that can get input of a filename (mp3 file) and then get the duration of that mp3 file. Let me know if anyone knows anything... thanks!


James Heinrich
getID3() v1 developer
Posts: 1477
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada

Post by James Heinrich » Fri Apr 14, 2006 1:41 am

Exerpted from /demos/demo.basic.php

Code: Select all

$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);
echo @$ThisFileInfo['playtime_string']; // playtime in minutes:seconds, formatted string

Post Reply