I am trying to retrieve the duration of some songs in my project. I integrated getID3 in my app using the phansys bundle - it works fine but for some of my songs I get an error:
Undefined index: playtime_string.
Here is my source code:
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($this->getFullpath());
if (isset($ThisFileInfo['playtime_string'])){
$len= $ThisFileInfo['playtime_string'];
}
else{
/*
* Here i wonder what i have to do in this case
*/
}
I am really stuck now I am in real need of getting the songs duration. In fact I must get this information in my mobile application.
Is there any other way to get mp3s duration in php?