MP3 ID3 tags are placed at the bottom of the MP3 file and are meant to provide a description of the music file.
I have developed a Processing library to read the ID3v1.1 tags from MP3 files: ID3 library.
ID3 v1.1 Tags
ID3 tags consist of 128 bytes arranged in the following fields:
Magic number | 3 bytes('TAG') |
Song title | 30 bytes |
Artist | 30 bytes |
Album | 30 bytes |
Year | 4 bytes |
Comment | 30 bytes |
Genre | 1 byte |
The Genre field is an index to the list of possible genres.
ID3v1.1 introduced a new field, by rearranging the comment field: instead of 30 characteres, the comment field is now 28 followed by a zero byte followed by a track number. This way it remains backward compatible with ID3v1 (a comment will always end with a zero byte anyway).
The Library
The ID3 Processing library only provides one method: readID3(String filename). This method reads the tags into public fields of the class that you can then access:
import jorgecardoso.processing.id3.*;
void setup() {
ID3 id3 = new ID3(this);
id3.readID3("alane.mp3");
println("Song: " + id3.songTitle);
println("Artist: " + id3.artist);
println("Album: " + id3.album);
println("Comment: " + id3.comment);
println("Year: " + id3.year);
println("Track:" + id3.track);
println("Genre: " + id3.genre);
}