Getting Track Number for FLAC

Getting Track Number for FLAC

Postby hippy » Tue Jan 10, 2012 12:25 am

Hi,

Very new to getID3 and I need to extract the track number of a FLAC file.

I follow the example and after the following lines, how do I get the track number for $filename which is a FLAC format.

Kindly advise.

$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);
getid3_lib::CopyTagsToComments($ThisFileInfo);
hippy
User
 
Posts: 2
Joined: Mon Jan 09, 2012 10:59 pm

Re: Getting Track Number for FLAC

Postby James Heinrich » Tue Jan 10, 2012 9:45 am

Best place to look for it would be in $ThisFileInfo['comments']['tracknumber']
Note that all values under ['comments'] (and comments_html/tags/tags_html) are stored as arrays of strings, so the track number (if present) would actually be in $ThisFileInfo['comments']['tracknumber'][0].

Taking a look at the data returned as show in demo.browse.php should give you a good idea of what data is where for any of your files.
James Heinrich
getID3() v1 developer
 
Posts: 1203
Joined: Fri May 04, 2001 11:00 am
Location: London, ON, Canada

Re: Getting Track Number for FLAC

Postby tomriddle » Thu May 31, 2012 11:07 am

Excellent. Thanks James. Came here from google because I needed to know exactly the same thing.

hippy: print_r($ThisFileInfo); may have helped you in this case, it'll show you everything that $getID3->analyze has returned.
tomriddle
User
 
Posts: 3
Joined: Thu May 31, 2012 11:06 am


Return to Support 1.x (resolved)

Who is online

Users browsing this forum: No registered users and 1 guest

cron