$getid3->audio doesn't exist

Locked
p3rk5
User
Posts: 4
Joined: Thu Jan 07, 2010 4:41 am
Are you a spambot?: no

$getid3->audio doesn't exist

Post by p3rk5 » Thu Jan 07, 2010 4:45 am

I'm currently using this code to view audio information:

Code: Select all

$getid3 = new getID3;
$file=$_FILES['file']['tmp_name'];
$ThisFileInfo = $getid3->analyze($file);
getid3_lib::CopyTagsToComments($ThisFileInfo);
However, I can't seem to be able to find the audio array anywhere. I printed the result of $ThisFileInfo and it is nowhere to be found. Any help is much appreciated!

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

Re: $getid3->audio doesn't exist

Post by James Heinrich » Thu Jan 07, 2010 12:49 pm

Check for any useful messages under the warning or error keys?

p3rk5
User
Posts: 4
Joined: Thu Jan 07, 2010 4:41 am
Are you a spambot?: no

Re: $getid3->audio doesn't exist

Post by p3rk5 » Thu Jan 07, 2010 4:38 pm

[error] => Array ( [0] => unable to determine file format

Why isn't it determining the format?

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

Re: $getid3->audio doesn't exist

Post by James Heinrich » Sat Jan 09, 2010 2:47 am

Most likely your file is not one of the ones that getID3 supports (see list). What kind of file is it?

p3rk5
User
Posts: 4
Joined: Thu Jan 07, 2010 4:41 am
Are you a spambot?: no

Re: $getid3->audio doesn't exist

Post by p3rk5 » Sat Jan 09, 2010 4:29 am

The file is an MP3, which I see is listed as supported.

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

Re: $getid3->audio doesn't exist

Post by James Heinrich » Sat Jan 09, 2010 4:48 am

Then it's very broken. Send a link to a sample file to info@getid3.org for analysis, if you like.

p3rk5
User
Posts: 4
Joined: Thu Jan 07, 2010 4:41 am
Are you a spambot?: no

Re: $getid3->audio doesn't exist

Post by p3rk5 » Sun Jan 10, 2010 5:37 am

Sent. Thanks for the help so far, hopefully we can sort this issue out.

soulhunter
getID3() v1 developer
Posts: 40
Joined: Mon Jan 11, 2010 5:37 pm
Are you a spambot?: no
Location: Kaliningrad, Russia
Contact:

Re: $getid3->audio doesn't exist

Post by soulhunter » Mon Jan 11, 2010 5:43 pm

I haven't seen the 2.0.0 source code, but in 1.7.9 it determines the format for mp3 files according to extension if no headers were found, and temporary uploaded files do not have it.
This may be a reason for such error.
Try to move_uploaded_file() with extension .mp3 first and then try to analyze it.

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

Re: $getid3->audio doesn't exist

Post by James Heinrich » Tue Jan 12, 2010 1:51 am

The same issue (and kludgy workaround) exists for both 1.x and 2.x
It really shouldn't need to be, but there's so much broken software out there that malformed MP3 files are unfortunately very common.

Locked