Get tags

Locked
jarc
User
Posts: 3
Joined: Sun Jan 21, 2007 11:29 am

Get tags

Post by jarc » Sun Jan 21, 2007 2:59 pm

Hi
Can you tell me how can I extract tags, like artist, album, year...

In the demo basic are:
echo 'Bitrate: ' . @$getid3->info['audio']['bitrate'] . '<br>';
echo 'Playtime: ' . @$getid3->info['playtime_string'] . '<br>';

We can add other like echo 'sample_rate: ' . @$getid3->info['audio']['sample_rate'] . '<br>';

But how we can get artist? (some basic please).

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
Contact:

Post by James Heinrich » Sun Jan 21, 2007 3:14 pm

The other two lines from the end of the basic demo are exactly what you're asking about:

Code: Select all

echo @$ThisFileInfo['comments_html']['artist'][0]; // artist from any/all available tag formats
echo @$ThisFileInfo['tags']['id3v2']['title'][0];  // title from ID3v2

jarc
User
Posts: 3
Joined: Sun Jan 21, 2007 11:29 am

Post by jarc » Sun Jan 21, 2007 3:43 pm

James Heinrich wrote:The other two lines from the end of the basic demo are exactly what you're asking about:

Code: Select all

echo @$ThisFileInfo['comments_html']['artist'][0]; // artist from any/all available tag formats
echo @$ThisFileInfo['tags']['id3v2']['title'][0];  // title from ID3v2
HI
Thank you. This work fine:
@$getid3->info['tags']['id3v2']['title'][0];

But this, do not work:
@$getid3->Info['comments_html']['artist'][0]




By the way, how can I get "cover art" from tag?

Thanks

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Sun Jan 21, 2007 8:12 pm

jarc wrote:But this, do not work:
@$getid3->Info['comments_html']['artist'][0]

the comments_html key has been removed. Use the comments key instead together with proper charset.

Locked