ID3 file format preface, November 2001, I decided to organize my hard disk in the hard disk, but use WinAmp ExpleroR efficiency too slow, I found only one MP3 / Tag Studio V2.6 on the Internet. Yes, but unfortunately, it is not said that it can only use 30 days, and to advertise. I am, so troublesome. In the case, I decided to write a letter from here to online, wrote the first free software and this article in this life. You can see the details and download links of this software at http://www.9cbs.net/cnshare/soft/10/10119.shtm. The ID3v1 ID3v1 is relatively simple, it is stored at the end of the MP3 file, open an MP3 file with the 16-encycloped editor, check the 128 order storage bytes at the end, the data structure is defined as follows: char Header [3]; / * The label head must be "tag" otherwise not the label * / char Title [30]; / * Title * / char Artist [30]; / * Author * / char album [30]; / * Collection * / char Year [4 ]; / * Out of age * / char comment [30]; / * Note * / char genre; / * Type * / ID3v1 all information is stored, without any identifier, such as less than 30 headings Bytes, use '/ 0' to make up, otherwise the information is incorrectly caused.
GENRE uses the original code, the comparison table is as follows: / * Standard genres * / 0 = "blues"; 1 = "ClassicRock"; 2 = "country"; 3 = "DANCE"; 4 = "disco"; 5 = "funk "; 6 =" grunge "; 7 =" hip-hop "; 8 =" jazz "; 9 =" metal "; 10 =" newage "; 11 =" Oldies "; 12 =" other "; 13 =" POP "; 14 =" R & B "; 15 =" RAP "; 16 =" reggae "; 17 =" Rock "; 18 =" techno "; 19 =" industrial "; 20 =" alternative "; 21 =" SKA "; 22 = "DeathMetal"; 23 = "PRANKS"; 24 = "SoundTrack"; 25 = "eURO-TECHNO"; 26 = "Ambient"; 27 = "trip-hop"; 28 = "Vocal"; 29 = "JAZZ Funk "; 30 =" fusion "; 31 =" trance "; 32 =" classical "; 33 =" instructionAl "; 34 =" acid "; 35 =" house "; 36 =" game "; 37 =" SoundClip "; 38 =" gospel "; 39 =" noise "; 40 =" alternrock "; 41 =" bass "; 42 =" sooul "; 43 =" punk "; 44 =" space "; 45 =" Meditative "; 46 = "InStrumentalPop"; 47 = "InStrumentAlRock"; 48 = "Ethnic"; 49 = "gothic"; 50 = "DARKWAVE"; 51 = "techno-industrial"; 52 = "electronic"; 53 = "POP-FOLK "; 54 =" eurodance "; 55 =" DREAM "; 56 =" southernrock "; 57 =" comedy "; 58 =" CULT "; 59 =" gangsta "; 60 =" TOP40 "; 61 =" Christianrap "; 62 = "POP / FUNK"; 63 = "jungle"; 64 = "
NativeAmerican "; 65 =" Cabaret "; 66 =" newwave "; 67 =" psychadelic "; 68 =" rave "; 69 =" showTunes "; 70 =" trailer "; 71 =" LO-FI "; 72 =" Tribal "; 73 =" acidpunk "; 74 =" acidjazz "; 75 =" polka "; 76 =" retro "; 77 =" musical "; 78 =" Rock & roll "; 79 =" HardRock "; / * Extended genres * / 80 = "folk"; 81 = "folk-Rock"; 82 = "nationalfolk"; 83 = "swing"; 84 = "fastfusion"; 85 = "bebob"; 86 = "latin"; 87 = "revAl" 88 = "Celtic"; 89 = "bluegrass"; 90 = "avantgarde"; 91 = "gothicrock"; 92 = "processiverock"; 93 = "psychedelicrock"; 94 = "SymphonicRock"; 95 = "SLOWROCK"; 96 = "Bigband"; 97 = "chorus"; 98 = "easylistening"; 99 = "acoustic"; 100 = "humour"; 101 = "Speech"; 102 = "CHANSON"; 103 = "Opera"; 104 = " Chambermusic "; 105 =" SONATA "; 106 =" Symphony "; 107 =" bootybass "; 108 =" primus "; 109 =" porNGroove "; 110 =" Satire "; 111 =" slowjam "; 112 =" club "; 112 =" club " 113 = "TANGO"; 114 = "Samba"; 115 = "folklore"; 116 = "BALLAD"; 117 = "Powerballad"; 118 = "rhythmicsoul"; 119 = "freestyle"; 120 = "duet"; 121 = "Punkrock"; 122 = "drumsolo"; 123 = "acapella"; 124 = "eURO-house"; 125 = "Dancehall"; 126 = "GOA"; 127 = "
Drum & bass "; 128 =" club-house "; 129 =" hardcore "; 130 =" terror "; 131 =" indIE "; 132 =" BRITPOP "; 133 =" negerpunk "; 134 =" polskpunk "; 135 =" BEAT "; 136 =" ChristiangangStarap "; 137 =" Heavymetal "; 138 =" BlackMetal "; 139 =" crossover "; 140 =" contemporarychristian "; 141 =" ChristianRock "; 142 =" merengue "; 143 =" salsa " 144 = "trashmetal"; 145 = "anime"; 146 = "jpop"; 147 = "synthpop"; ID3V2 ID3v2 to now have 4 versions, but popular play software generally only supports the third edition, Id3v2. 3. Since ID3v1 records at the end of the MP3 file, Id3v2 has to record the head of the MP3 file (if one day release ID3v3, I really don't know where to record). It is precisely because of this reason, Id3v2 is more than ID3V1 Slow. And the ID3V2 structure is much more complicated than ID3v1, but it is comprehensive and scalable and expanded in the former. Here is the ID3v2.3. Each ID3V2.3 tag is a label head and several tag frames or An extended label head consists. About track information such as title, authors, etc., in different label frames, extended label heads and label frames are not necessary, but each tag must have a tag frame. Tag head and label The frame is stored together in the first part of the MP3 file. First, the tag head records the head of 10 bytes of ID3V2.3 in the first order of the file. The data structure is as follows: char header [3]; / * must be "ID3" otherwise It is considered that the label does not exist * / char ver; / * version number ID3v2.3 record 3 * / char revision; / * Sub-version number This version is recorded as 0 * / char flag; / * Store the flag of the flag, this version only Triple, detail later * / char size [4]; / * Tag size, 10 bytes of the label head and the size of all label frames * / 1. Sign byte flag bytes are generally 0 The definition is as follows: ABC00000
A - means if you use unsynchronisation (this word doesn't know what it means, the dictionary is not found, generally not set) b - indicates whether there is an extended header, generally not (at least WinAMP is not recorded), so it is generally not set c - means whether it is a test label (99.99% tag is not testing, so it is generally not set) 2. The label has a total of four bytes, but only 7 digits per byte, the highest bit is not used. Heavy is 0. So the format is 0xxxxxxxxxxedxx 0xxxxxxxxxx 0xxxxxxx calculation to remove 0, get a 28-bit binary number, is the label size (do not understand why doing this), the calculation formula is as follows: int total_size; total_size = (size [0] & 0x7f * 0x200000 (Size [1] & 0x7F) * 0x400 (Size [2] & 0x7F) * 0x80 (Size [3] & 0x7f) Second, the label frame has a 10-byte frame header with each tag frame. The content consisting of at least one byte is not fixed. They are also sequentially stored in the file, and there is no special character separation in the file and other tag frames. The content of a complete frame is obtained only after the content from the frame header can only be read. When reading, you should pay attention to the size, and do not read the content or frame of the other frames. The definition of the frame is as follows: Char frameID [4]; / * Identify one frame with four characters, indicating the content, and there is a commonly used identification control table * / char size [4]; / * The size of the frame content, no Including a frame header, not less than 1 * / char flags [2]; / * Store flag, only 6 digits, later explain the detailed explanation * / 1. Frame identification with four characters to identify one frame, indicating the content meaning of a frame The commonly used controls are as follows: Tit2 = Title represents the title of this song, the same TPE1 = author TALB = Collection TRCK = track format: n / m where N is the native of the special concentration, m is the special set of M First, N and M represent the digital TYER = era in the ASCII code is the digital TCON = type of the ASCII code to represent a string to represent the string of the string: "ENG / 0 Note Content", where the eNG represents the natural note. Language
2. The size of this can have no labeling, the algorithm, the 8-bit full-purpose, format of each byte, the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = size [0] * 0x100000000 size [1] * 0x10000 Size [2] * 0x100 size [3]; 3. The flag is only defined by 6 digits, and the other 10 is 0, but the 16 digits are 0 in most cases. The format is as follows: ABC00000 IJK00000 A - Label Protection Sign, Set this frame as a waste B - file protection flag, set this frame as a waste C - read-only flag, set this frame not to modify (but I didn't find A Software Rational Association This flag) I - compressed flag, set one byte when a byte stores two BCD code indicates the number J - encryption flag (no MP3 file label is encrypted) K - group flag, set Explanation This frame and other frames are worth mentioning that WINAMP will add a '/ 0' in front of the content when saving and reading the frame content, and calculates this byte in the size of the frame content. Detailed situation can be queried by www.id3.org, for the reading and writing of ID3v1 and id3v2, I wrote two classes with Delphi to implement, I can write to me QDZHANG@sohu.com attached: Frame ID meaning 4 Declared ID3v2 FrameSthe Following Frames Are Declared in this Draft.
Aenc Audio Encryption Apic Attached Picture
Comm Comments Commer Frame
ENCR ENCRYPTION METHOD Registration Equa Equalization etco event Timing Codes
GeoB General Encapsulated Object Grid Group Identification Registration
IPLS Involved People List
Link Linked Information
MCDI Music CD Identifier MLLT MPEG LOCATION LOOKUP TABLE
OWNE OWNERSHIP FRAME
Priv Private Frame PCNT Play Counter Popm Popularime Poss Posctions Synchronisation Frame
RBUF Recommended Buffer Size Rvad Relative Volume Adjustment RVRB REVERB
Sylt Synchronized Lyric / Text Sytc Synchronized TEMPO CODES
TALB Album / Movie / Show title TBPM BPM (beats per minute) TCOM Composer TCON Content type TCOP Copyright message TDAT Date TDLY Playlist delay TENC Encoded by TEXT Lyricist / Text writer TFLT File type TIME Time TIT1 Content group description TIT2 Title / songname / content description TIT3 Subtitle / Description refinement TKEY Initial key TLAN Language (s) TLEN Length TMED Media type TOAL Original album / movie / show title TOFN Original filename TOLY Original lyricist (s) / text writer (s) TOPE Original artist (s) / performer (s) TORY Original release year TOWN File owner / licensee TPE1 Lead performer (s) / Soloist (s) TPE2 Band / orchestra / accompaniment TPE3 Conductor / performer refinement TPE4 Interpreted, remixed, or otherwise modified by TPOS Part of a set TPUB Publisher Trck TRACK NUMBER / POSITION INTERNET RADA RECORDING DATES TRSITERNET RADIO Station Owner Tsiz Size Tsrc ISRC (International Standard Recording Code) Tsse Software / Hardware A Nd settings buy for encoding type, txxx user defined text information frameufid unique file iDentifier user terms of use USLT unsychronized lyric / text transcription
WCOM Commercial information WCOP Copyright / Legal information WOAF Official audio file webpage WOAR Official artist / performer webpage WOAS Official audio source webpage WORS Official internet radio station homepage WPAY Payment WPUB Publishers official webpage WXXX User defined URL link frame