Byte | Content | ||||||||||||||||||||||||||
0-3 | Standard audio frame header (as descripted above). Mostly it contains values
FF FB 30 4C, from which you can count FrameLen = 156 Bytes. And thats exactly enough space for storing
VBR info. This header contains some important information valid for the whole file: - MPEG (MPEG1 or MPEG2) - SAMPLING rate frequency index - CHANNEL (JointStereo etc.) | ||||||||||||||||||||||||||
4-x | Not used till string "Xing" (58 69 6E 67). This string is used as a main VBR file identifier. If it is not found, file is supposed to be CBR. This string can be placed at different locations according to values of MPEG and CHANNEL (ya, these from a few lines upwards): | ||||||||||||||||||||||||||
36-39 | "Xing" for MPEG1 and CHANNEL != mono (mostly used) | ||||||||||||||||||||||||||
21-24 | "Xing" for MPEG1 and CHANNEL == mono | ||||||||||||||||||||||||||
21-24 | "Xing" for MPEG2 and CHANNEL != mono | ||||||||||||||||||||||||||
13-16 | "Xing" for MPEG2 and CHANNEL == mono | ||||||||||||||||||||||||||
After "Xing" string there are placed flags, number of frames
in file and a size of file in Bytes. Each of these items has 4 Bytes and it is stored as
'int' number in memory. The first is the most significant Byte and the last is the least. Following schema is for MPEG1 and CHANNEL != mono: | |||||||||||||||||||||||||||
40-43 | Flags
| ||||||||||||||||||||||||||
44-47 | Frames Number of frames in file (including the first info one) | ||||||||||||||||||||||||||
48-51 | Bytes File length in Bytes | ||||||||||||||||||||||||||
52-151 | TOC (Table of Contents) Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file. Each Byte has a value according this formula: (TOC[i] / 256) * fileLenInBytes So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use: TOC[(60/240)*100] = TOC[25] and corresponding Byte in file is then approximately at: (TOC[25]/256) * 5000000 If you want to trim VBR file you should also reconstruct Frames, Bytes and TOC properly. | ||||||||||||||||||||||||||
152-155 | VBR Scale I dont know exactly system of storing of this values but this item probably doesnt have deeper meaning. |
Bytes | Length | Content | ||
0-2 | 3 | Tag identifier. Must contain "TAG" string if Tag is valid. | ||
3-32 | 30 | Song Name | ||
33-62 | 30 | Artist | ||
63-92 | 30 | Album | ||
93-96 | 4 | Year | ||
97-126 | 30 | Comment | ||
127 | 1 | Genre |
22 | Death Metal | |
138 | Black Metal | |
144 | Thrash Metal | |
9 | Metal | |
43 | Punk | |
129 | Hardcore |
Bytes | Content | |
0-2 | TAG identifier. It contains of string "ID3" | |
3-4 | TAG version. Can be eg. 03 00 | |
5 | Flags | |
6-9 | Size of TAG |
Bytes | Content | |
0-3 | Frame identifier | |
4-7 | Size | |
8-9 | Flags |
Iden. | Description | |
TRCK | Track number | |
TENC | Encoded By | |
WXXX | URL | |
TCOP | Frame identifier | |
TOPE | Original Artist | |
TCOM | Composer | |
TCON | Genre | |
COMM | Comments | |
TYER | Year | |
TALB | Album | |
TPE1 | Artist | |
TIT2 | Song name |
Flag | Description | |
a | TAG alter preservation | |
b | File alter preservation | |
c | Read only | |
i | Compression | |
j | Encryption | |
k | Grouping identity |
54 | 50 | 45 | 31 | 00 | 00 | 00 | 07 | 00 | 00 | 00 | 53 | 53 | 6C | 61 | 79 | 65 | 72 |
T | P | E | 1 | 7 | S | l | a | y | e | r |
43 | 4F | 4D | 4D | 00 | 00 | 00 | 0C | 00 | 00 | 00 | 65 | 6E | 67 | 00 | 63 | 6F | 6D | 6D | 65 | 6E | 74 |
C | O | M | M | 0C | e | n | g | c | o | m | m | e | n | t |