id3v1
These go at the end of the file. This makes it quick and easy to attach (and remove) without much fuss.
Segments are fixed-length, which (obviously) limits the content.
All text fields use ISO-8859-1, unless otherwise specified. Not everybody seems to get this…
Basic block
| Size (bytes) | Name (type) | |||||||||||||||||||
| 3 | Block type identifier | String “TAG” | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 30 | Track title | Text | ||||||||||||||||||
| 30 | Artist | |||||||||||||||||||
| 30 | Album | |||||||||||||||||||
| 4 | Year | |||||||||||||||||||
| 30 |
Since the “Zero” marker in the comment field is what marks the block as being v1.1, any non-zero value removes the next byte as a track-number field and sets the comment field length to 30 bytes. | |||||||||||||||||||
| 1 | Genre | (list) | ||||||||||||||||||
Extension
| Size (bytes) | Name (type) | |
| 4 | Block type identifier | String “TAG+” for ID3v1 extension data |
|---|---|---|
| 60 | Track title | Added to the fields in the basic block |
| 60 | Artist | |
| 60 | Album | |
| 1 | Speed | 00…04 |
| 30 | Genre | Text |
| 6 | Start time | String “mmmm:ss”, e.g. “0004:20” for “4 minutes 20 secounds” |
| 6 | End time | String “mmmm:ss” |
id3v2.3
Main header
| Size (bytes) | Name (type) | |
| 3 | Identifier (String) |
“$54 41 47” (“ TAG”)
|
|---|---|---|
| 2 | Version |
“$03 00” (“v3.00”) |
| 1 | Flags |
“%abc00000”
|
| 4 | Header size |
4 bytes “%0×××××××”, for a total of 28 bits.
Size of id3v2 tags block, excluding header block. |
Extended header
| Size (bytes) | Name (type) | |
| 4 | Header size |
Usually 6 or 10, excluding self
|
|---|---|---|
| 2 | Flags |
Binary: “%x0000000 00000000”
|
| 4 | Padding size |
Frame header
| 4 | Frame name |
String, [A…Z] +
3×[A…Z0…9] Names starting with [ XYZ] are experimental
|
|---|---|---|
| 4 | Header size | Size of data block |
| 2 | Flags |
“%abc00000
ijk00000”
|
| Data block | |
Frame types
Text frame
| 1 | Text encoding |
|
|---|---|---|
| Text | ||
Picture
| 1 | Text encoding | |
|---|---|---|
| … | MIME type | Text string (null-terminated) |
| 1 | Picture type |
|
| Description | Text string (null-terminated) | |
| … | Picture file | |
Private frame
| … | Identifier | Text (null-terminated) |
|---|---|---|
| … | Data | |
…misc…
Unsynchronization
Add null after “$ff”;
“%11111111 111×××××” → “%11111111 00000000 111×××××”
First intended to only add null between $ff and %111×××××, but $ff 00 appears to have padding, and therefore needs to actually have one.
“$ff 00” → “$ff 00 00”
id3v2.4
AFAICT, this is basically an extension to the fields and their contents. This document concerns mostly how these fields are wrapped externally. Mostly.
In the event of a proper excursion into the internals of those fields, that will be in the form of this document being in two parts.
Links