Problem analyzing SOME mp3s

The place for "I can't figure out how to..." questions.
Post Reply
Posts: 1
Joined: Thu Jun 12, 2014 7:30 pm
Are you a spambot?: no

Problem analyzing SOME mp3s

Post by cgoering » Thu Jun 12, 2014 7:41 pm

I came across getID3() when researching a solution to get the duration of audio files within an application. I have implemented v1.9.7 and have begun testing the functionality with a number of mp3 files. I'm finding that, when running the .analyze function on some files, the script executes as expected and displays the result when I echo '<pre>'.htmlentities(print_r($info, true)).'</pre>';

However, in other files, the result that is returned is a blank page. I have been unable to figure out any rhyme or reason behind why this is occurring for some mp3 files and not others. I have error reporting turned on, so it is not a case where this or any other code on the page is throwing an error that is terminating the script prematurely.

I ran demo.browse.php on the directory where the files are located and I am able to see data for all of the files, so it seems to just be a problem when I call the function from within my own application.

Has anybody encountered anything like this? Suggestions would be greatly appreciated.

Thank you,

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

Re: Problem analyzing SOME mp3s

Post by James Heinrich » Thu Jun 12, 2014 7:52 pm

When getID3 analyzes a file it should always return something, even if that returned data contains basically just an error message. You might try var_dump in place of echo print_r as that will always give you output, even if that output is something special like null or false.

Also put some kind of output before and after the call to getID3->analyze() to confirm that it is running to completion.

Post Reply