ID3 Reader

This library was originally made by Jacob Seidelin using ID3v1 for demo'ing his BinaryAjax library. [http://www.nihilogic.dk/labs/id3/]
It was then extended by me to include the ID3v2 tag specification [http://www.id3.org/id3v2.4.0-structure], while I was working at Opera Software, in the context of the Unite Media Player application which was developed using server side JavaScript.

Source Code

Repository

Demo

  1. Click to read the ID3 info from the following music files:
  2. Use your own local files:
  3. You can also drag your local files here if it's supported by your browser
Artist
Title
Album
Year
Comment
Genre
Track
Lyrics
Cover Art

Technical Information

This library will only download the relevant data from the mp3 file whenever the webserver supports the HTTP Range feature, otherwise the entire file will be downloaded at the cost of degrading the performance of the library. This library is not complete and there is still some features missing and/or going on:

How To Use It

In its simplest form:
ID3.loadTags("filename.mp3", function() {
    var tags = ID3.getAllTags(filename);
    alert(tags.artist + " - " + tags.title + ", " + tags.album);
});
by specifying specific tags:
ID3.loadTags("filename.mp3", function() {
    var tags = ID3.getAllTags(filename);
    alert(tags.COMM.data + " - " + tags.TCON.data + ", " + tags.WXXX.data);
},
{tags: ["COMM", "TCON", "WXXX"]});
or even by specifying shortcuts instead of cryptic tags:
ID3.loadTags("filename.mp3", function() {
    var tags = ID3.getAllTags(filename);
    alert(tags.comment + " - " + tags.track + ", " + tags.lyrics);
},
{tags: ["comment", "track", "lyrics"]});

Documentation

ID3.loadTags(url, cb, [options])
ID3.getAllTags(url)
Currently supported frames: Shortcuts: A comprehensive list of all tags defined in the specification can be found here: http://www.id3.org/id3v2.3.0#head-e4b3c63f836c3eb26a39be082065c21fba4e0acc