ID3 Tag standard = 128 bytes of text divided into 6 fields which can be added on end of MP3 file. This standard was created by NamkraD in 1996.
ID3 Tag begins on position -128 bytes from end of file. If there is an ID3 Tag identifier - "TAG" on position 0, then the ID3 Tag is already appended. Next fields carry data:
|
Byte |
3 - 32 |
33 - 62 |
63 - 92 |
93 - 96 |
97 - 126 |
127 |
|
Field name |
Track name |
Artist name |
Album name |
Year |
Comment |
Genre |
You can see that genres are determined by one byte of data only. This byte has to be translated into text from following listing:
Byte Description
---------------------
00 - Blues
01 - Classic Rock
02 - Country
03 - Dance
04 - Disco
05 - Funk
06 - Grunge
07 - Hip-Hop
08 - Jazz
09 - Metal
10 - New Age
11 - Oldies
12 - Other
13 - Pop
14 - R&B
15 - Rap
16 - Reggae
17 - Rock
18 - Techno
19 - Industrial
20 - Alternative
21 - Ska
22 - Death Metal
23 - Pranks
24 - Soundtrack
25 - Euro-Techno
26 - Ambient
27 - Trip-Hop
28 - Vocal
29 - Jazz+Funk
30 - Fusion
31 - Trance
32 - Classical
33 - Instrumental
34 - Acid
35 - House
36 - Game
37 - Sound Clip
38 - Gospel
39 - Noise
40 - Alternative Rock
41 - Bass
42 - Soul
43 - Punk
44 - Space
45 - Meditative
46 - Instrumental Pop
47 - Instrumental Rock
48 - Ethnic
49 - Gothic
50 - Darkwave
51 - Techno-Industrial
52 - Electronic
53 - Pop-Folk
54 - Eurodance
55 - Dream
56 - Southern Rock
57 - Comedy
58 - Cult
59 - Gangsta
60 - Top 40
61 - Christian Rap
62 - Pop/Funk
63 - Jungle
64 - Native US
65 - Cabaret
66 - New Wave
67 - Psychadelic
68 - Rave
69 - Showtunes
70 - Trailer
71 - Lo-Fi
72 - Tribal
73 - Acid Punk
74 - Acid Jazz
75 - Polka
76 - Retro
77 - Musical
78 - Rock & Roll
79 - Hard Rock
Added on December 12, 1997 in cooperation with Winamp:
80 - Folk
81 - Folk-Rock
82 - National Folk
83 - Swing
84 - Fast Fusion
85 - Bebob
86 - Latin
87 - Revival
88 - Celtic
89 - Bluegrass
90 - Avantgarde
91 - Gothic Rock
92 - Progressive Rock
93 - Psychedelic Rock
94 - Symphonic Rock
95 - Slow Rock
96 - Big Band
97 - Chorus
98 - Easy Listening
99 - Acoustic
100 - Humour
101 - Speech
102 - Chanson
103 - Opera
104 - Chamber Music
105 - Sonata
106 - Symphony
107 - Booty Bass
108 - Primus
109 - Porn Groove
110 - Satire
Added on January 26, 1998 to ensure compatibility with Winamp 1.7:
111 - Slow Jam
112 - Club
113 - Tango
114 - Samba
115 - Folklore
Added on April 13, 1998 to ensure compatibility with Winamp 1.90:
116 - Ballad
117 - Power Ballad
118 - Rhytmic Soul
119 - Freestyle
120 - Duet
121 - Punk Rock
122 - Drum Solo
123 - Acapella
124 - Euro-House
125 - Dance Hall
126 - Goa
127 - Drum & Bass
128 - Club-House
129 - Hardcore
130 - Terror
131 - Indie
132 - BritPop
133 - Negerpunk
134 - Polsk Punk
135 - Beat
136 - Christian Gangsta Rap
137 - Heavy Metal
138 - Black Metal
139 - Crossover
140 - Contemporary Christian
141 - Christian Rock
Added on Jun 1, 1998 to ensure compatibility with Winamp 1.91:
142 - Merengue
143 - Salsa
144 - Trash Metal
145 - Anime
146 - Jpop
147 - Synthpop
Updates:
July 2, 1999 - linking images with relative path has been improved
October 27, 2000 - third indication field added
August 28, 2002 - GRE (genre) field added
The Lyrics3 Tag is an expansion of the ID3 Tags. It adds the data at the end
of the file, before the ID tag.
To check for Lyrics tag, first look for the 9 bytes BEFORE the ID TAG (i.e.
read at location -137 from the end of the file, 9 bytes. If the 9 bytes read
'LYRICSEND' then this means that an Lyrics3 Tag v1.00 has been used. If the
9 bytes read 'LYRICS200' then the new Lyrics3 Tag v2.00 has been used. If a
new application is to be build, it should support besides of Lyrics3 Tag 2.00
as well the reading of Lyrics3 Tag version 1.00 because of backward compatibility.
This older tag uses a seek method. If you find 'LYRICSEND' just before the ID tag, read 5100 bytes before that string, and search for the string 'LYRICSBEGIN'. If you find it, then the lyrics starts from right after then last char of the 'LYRICSBEGIN' (no null terminator) and ends just before the 'LYRICSEND'. Line delimiters are CR+LF, and no null char used.
The file has the following sections:
There are no delimiters between each section!
The lyrics can include Timestamps. Timestamps are marked by [mm:ss] and must not use spaces. They can appear anywhere in the lyrics (beginning or anywhere in each line) and more then one timestamp can be used in the same line. Timestamps must not necessarily increase with the lines... a song can go back to the refrain several times which can be only once in the text, and have several different timestamps on them.
The new v2.00 tag is more complicated, but faster for use, and can be enhanced with full backward compatibility.
The tag uses text only. Even the sizes are written as fixed 5 or 6 bytes of digits (with padded zeros - no spaces allowed). Fields data can include chars at the range of ASCII 01 to 254.
Lyrics3 v2.00 uses FIELDS. There can be an unlimited number of fields (currently
there are only a few defined, but others will be added in the future). Each
field has its own variable or fixed size. All fields uses a simple structure
that includes the field ID, it's size and the field data. This makes it possible
to read unknown fields and write them back when saving the tag.
There are no required fields in the tag, but at least one field must exist.
Fields can appear in any order in the tag, except the indication field, that
MUST be the first field, if it is used.
Here is the structure of the file using Lyrics3 v2.00 tags:
A field record structure is:
Here is a step by step description of how to read the lyrics3 v2.00 tag:
Reading a field (step 5):
Fields that include more then one line uses
Following is the list of currently defined field IDs. Other fields will be added, if needed on newer versions of the Lyrics3 v2.00 specifications, but the tag is designed in such a way that unknown fields can be ignored.
ID Max size Description
--- -------- ----------------------------------------------------------
IND 00003 Indications field. This is a fixed record field that
currently includes three indications. In the future other
indications might be added after the existing ones, but
existing indications will stay on the same byte positions
inside the field record.
If the indication field is used, it MUST be the first field!
The indication field structure is to follow.
LYR 99999 Lyrics multi line text. Timestamps can be used anywhere in
the text in any order. Timestamp format is [mm:ss] (no spaces
allowed in the timestamps).
INF 99999 Additional information multi line text.
AUT 00250 Lyrics/Music Author name.
EAL 00250 Extended Album name.
EAR 00250 Extended Artist name.
ETT 00250 Extended Track Title.
IMG 99999 Link to an image files (BMP, JPG, GIF format).
Image lines include filename, description and timestamp
separated by delimiter - two ASCII chars 124 ("||").
Description and timestamp are optional, but if timestamp is
used, and there is no description, two delimiters ("||||")
should be used between the filename and the timestamp.
Multiple images are allowed by using a [CR][LF] delimiter
between each image line. No [CR][LF] is needed after the last
image line. Number of images is not limited (except by the
field size).
Filename can be in one of these formats:
- Filename only - when the image is located in the same path
as the MP3 file (preferred, since if you move the mp3 file
this will still be correct)
- Relative Path + Filename - when the image is located in a
subdirectory below the MP3 file (i.e. images\cover.jpg) or
in any directory above the MP3 file (i.e. ..\artist.jpg or
...\image.jpg - as per dot convency)
- Full path + Filename - when the image is located in a
totally different path or drive. This will not work if the
image is moved or drive letters has changed, and so should
be avoided if possible (i.e. c:\images\artist.jpg)
Description can be up to 250 chars long.
Timestamp must be formatted like the lyrics timestamp
which is "[mm:ss]". If an image has a timestamp, then
the visible image will automatically switch to that image
on the timestamp play time, just the same as the selected
lyrics line is switched based on timestamps.
GRE 00250 Free text genre
This is an addition to the Genre field of ID3v1 Tag where only
147 predefined genres exist. Using GRE field it is possible to
add own "free text" genres. The GRE field is not to be used
when genre can be found in the genre list of ID3v1 Tag. When
GRE field is to be used, genre field of ID3v1 tag MUST be set
to $FF ("none"). If the ID3V1 tag is changed to anything other
then $FF, the GRE tag is ignored.
The extended Album, Artist and Track are an extension to the fields in the ID3v1 tag - which are limited to 30 chars. If these extended fields exist, make sure their first 30 chars are exactly the same as the ones in the ID3v1 tag. If they are the same, display the extended field. If not, display the one from the ID tag. These 'mismatched' extended fields, should be removed when saving the Lyrics3 tag.
When saving the extended fields, make sure to copy the first 30 chars of each field to the ID3 tag matching fields. It is recommended NOT to save extended fields at all, if they are not larger then 30 chars.
Offset Bytes Meaning
----- ----- ------------------------------------------------------------
0 1 Lyrics found. '1' if an LYR field found in the tag, and '0' if not.
1 1 Timestamps used - '1' if Timestamps are used in the LYR tag
and '0' if not.
2 1 Inhibit tracks for random selection - '1' if inhibited, '0' if not.
There must be at least one field in the Lyrics3 v2.00. If no field exists the Lyrics3 v2.00 tag should not be saved at all.
The following includes all the information from AFTER the mp3 data until the ID tag. Please note that unless a [CR] [LF] is at the end of the line, no [CR] or [LF] should be added between lines.
LYRICSBEGIN IND00003 110 EAL00041 Album name that is larger then 30 chars ! EAR00050 Artist name or band that is larger then 30 chars ! ETT00042 Track name which is larger then 30 chars ! INF00090 This track was actually recorded in several places around the world[CR][LF] and mixed at the US[CR][LF] AUT00048 The lyrics were written by someone.. is it you ? IMG00086 album_cover.jpg||Album cover||[00:10][CR][LF] jumping.jpg||He jumps at the audience!||[01:00] LYR00630 [00:02]Let's talk about time[CR][LF] [00:02]tickin' away every day[CR][LF] [00:05]so wake on up before it's gone away[CR][LF] [00:10]catch the 411 and stay up like the sun[CR][LF] [00:20]remind yourself what's done and done[CR][LF] [00:32]so let yesterday stay with the bygones[CR][LF] [00:40]keep your body and soul and your mind on[CR][LF] [00:55]the right track infact you gotta stay on[CR][LF] [01:20]the real black[CR][LF] [CR][LF] Chorus:[CR][LF] [01:25][05:45]Time is tickin' away[CR][LF] [01:42][05:55]you've gotta - live your life -[CR][LF] [02:11][06:24]day by day[CR][LF] [02:26][06:35]happy or sad, good or bad[CR][LF] [02:31][06:42]life is too short[CR][LF] [02:58][07:13]you've gotta - keep your head -[CR][LF] [03:01][07:19](Repeat)[CR][LF] GRE00009 Christmas 001082LYRICS200
The indications field size is three bytes. They are characters '110', which mean that
LYR field is to be found in the tag, timestamps are used in it and the track is
not inhibited for random selection.
The extended Album text size is 41 chars
The extended Artist name size is 50 chars
The extended Track name size is 42 chars
The Additional information size is 90 chars
The Lyrics Author size is 48 chars
The Image file link size is 86 chars
The Lyrics text size is 630 chars
The Genre text size is 9 chars
All the fields together (with the 'LYRICSBEGIN') is 001082 chars.
The ID3v1 tag that comes after this example should have :
Album field: 'Album name that is larger then'
Artist field: 'Artist name or band that is la'
Title field: 'Track name which is larger the'
Genre field: $FF
The Lyrics3 Tag specifications were written by Petr Strnad and Alon Gingold.
Since version 5.00 MP3 Manager supports ID3v2 in version 2.3.0 as a second tag after Lyrics3 Tag. This was done because of Winamp's support for this tag. However most of my objections against ID3v2 are still valid and I've added some new: