Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

PHP and ID3 tags

MP3 Piranha is a clever application which indexes your MP3 collection and uses the Amazon Web Service API to look up the album cover, related albums and provide a link to buy the album from Amazon. Out of curiosity, I ran a search for a PHP library to decode ID3 tags to see if such a thing could be built with PHP, and came up with this script by Leknor. The class is well written and I learnt a lot about ID3 tags looking through it—it seems they take up the last 128 bytes of an MP3 file and can be decoded using PHP’s unpack() function.

This is PHP and ID3 tags by Simon Willison, posted on 14th August 2002.

View blog reactions

Next: Thanks for the link

Previous: Q tag bad

3 comments

  1. Only ID3v1 takes up the last 128 bytes, but ID3v2 is at the beginning of an mp3 file, and is more fexible because it can (obviously) store more information.

    Breyten - 14th August 2002 18:10 - #

  2. check out this: http://randomfoo.net/?p=2002_06_09_archive.inc#851 71984 , which uses this guy's getID3 library ( http://silisoftware.audioarchive.org/scripts/ ) it's very nice, and far superior to the leknor script. btw. comment/comment name links should be made to pop up in a separate window...

    leonard - 15th August 2002 08:47 - #

  3. Cheers, that's an excellent script - Vorbis and ID3v2 support look really handy. I've fixed the target="_blank" issue (I had to downgrade the comments page to XHTML transitional in the process). The next version of my blog won't use pop up windows at all, no idea when it'll be finished though.

    Simon - 15th August 2002 09:16 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2002/08/14/phpAndID3Tags

A django site