- None: None
- No: No
- Windows xp, windows vista, windows 7, windows 8 desktop, windows 8 metro: Windows XP, Windows Vista, Windows 7, Windows 8 Desktop, Windows 8 Metro
- Native: Native
ID3 tag manager
This document is an informal standard and replaces the ID3 tag manager.3.0standard [ID3 tag manager]. A formal standard will use another revision numbereven if the content is identical to document. The contents in thisdocument may change for clarifications but never for added or alteredfunctionallity.Distribution of this document is unlimited.AbstractThis document describes the main structure of ID3v, which is arevised version of the ID3 tag manager informal standard [ID3 tag manager] version2.3.0. The ID3 tag manager offers a flexible way of storing audio metainformation within the audio file itself. The information may betechnical information, such as equalisation curves, as well astitle, performer, copyright etc.ID3v is meant to be as close as possible to ID3 tag manager.3.0 in orderto allow for implementations to be revised as easily as possible.1. Table of contentsStatus of this documentAbstract1. Table of contents2. Conventions in this document2. Standard overview3. ID3 tag manager overview3.1. ID3 tag manager header3.2. ID3 tag manager extended header3.3. Padding3.4. ID3 tag manager footer4. ID3 tag manager frames overview4.1. Frame header flags4.1.1. Frame status flags4.1.2. Frame format flags5. Tag location6. Unsynchronisation6.1. The unsynchronisation scheme6.2. Synchsafe integers2. Conventions in this documentText within ”” is a text string exactly as it appears in a tag.Numbers preceded with $ are hexadecimal and numbers preceded with %are binary. $xx is used to indicate a byte with unknown content. %xis used to indicate a bit with unknown content. The most significantbit (MSB) of a byte is called ‘bit 7’ and the least significant bit(LSB) is called ‘bit 0’.A tag is the whole tag described in this document. A frame is a blockof information in the tag. The tag consists of a header, frames andoptional padding. A field is a piece of information; one value, astring etc. A numeric string is a string that consists of thecharacters “0123456789” only.The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”,“SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in thisdocument are to be interpreted as described in RFC 2119 [KEYWORDS].3. ID3 tag manager overviewID3 tag manager is a general tagging format for audio, which makes it possibleto store meta data about the audio inside the audio file itself. TheID3 tag described in this document is mainly targeted at filesencoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2 layer IIIand MPEG-2.5, but may work with other types of encoded audio or as astand alone format for audio meta data.ID3 tag manager is designed to be as flexible and expandable as possible tomeet new meta information needs that might arise. To achieve thatID3 tag manager is constructed as a container for several information blocks,called frames, whose format need not be known to the software thatencounters them. At the start of every frame is an unique andpredefined identifier, a size descriptor that allows software to skipunknown frames and a flags field. The flags describes encodingdetails and if the frame should remain in the tag, should it beunknown to the software, if the file is altered.The bitorder in ID3 tag manager is most significant bit first (MSB). Thebyteorder in multibyte numbers is most significant byte first (e.g.$12345678 would be encoded $12 34 56 78), also known as big endianand network byte order.Overall tag structure:| Header (10 bytes) || Extended Header || (variable length, OPTIONAL) || Frames (variable length) || Padding || (variable length, OPTIONAL) || Footer (10 bytes, OPTIONAL) |In general, padding and footer are mutually exclusive. See details insections 3.3, 3.4 and 5.3.1. ID3 tag manager headerThe first part of the ID3 tag manager tag is the 10 byte tag header, laid outas follows:ID3 tag manager/file identifier “ID3” ID3 tag manager version $04 00ID3 tag manager flags %abcd0000ID3 tag manager size 4 * %0xxxxxxxThe first three bytes of the tag are always “ID3”, to indicate thatthis is an ID3 tag manager tag, directly followed by the two version bytes. Thefirst byte of ID3 tag manager version is its major version, while the secondbyte is its revision number. In this case this is ID3v. Allrevisions are backwards compatible while major versions are not. Ifsoftware with ID3v and below support should encounter versionfive or higher it should simply ignore the whole tag. Version orrevision will never be $FF.The version is followed by the ID3 tag manager flags field, of which currentlyfour flags are used.a – UnsynchronisationBit 7 in the ‘ID3 tag manager flags’ indicates whether or notunsynchronisation is applied on all frames (see section 6.1 fordetails); a set bit indicates usage.b – Extended headerThe second bit (bit 6) indicates whether or not the header isfollowed by an extended header. The extended header is described insection 3.2. A set bit indicates the presence of an extendedheader.c – Experimental indicatorThe third bit (bit 5) is used as an ‘experimental indicator’. Thisflag SHALL always be set when the tag is in an experimental stage.d – Footer presentBit 4 indicates that a footer (section 3.4) is present at the veryend of the tag. A set bit indicates the presence of a footer.All the other flags MUST be cleared. If one of these undefined flagsare set, the tag might not be readable for a parser that does notknow the flags function.The ID3 tag manager tag size is stored as a 32 bit synchsafe integer (section6.2), making a total of 28 effective bits (representing up to 256MB).The ID3 tag manager tag size is the sum of the byte length of the extendedheader, the padding and the frames after unsynchronisation. If afooter is present this equals to (‘total size’ – 20) bytes, otherwise(‘total size’ – 10) bytes.An ID3 tag manager tag can be detected with the following pattern:$49 44 33 yy yy xx zz zz zz zzWhere yy is less than $FF, xx is the ‘flags’ byte and zz is less than$80.3.2. Extended headerThe extended header contains information that can provide furtherinsight in the structure of the tag, but is not vital to the correctparsing of the tag information; hence the extended header isoptional.Extended header size 4 * %0xxxxxxxNumber of flag bytes $01Extended Flags $xxWhere the ‘Extended header size’ is the size of the whole extendedheader, stored as a 32 bit synchsafe integer. An extended header canthus never have a size of fewer than six bytes.The extended flags field, with its size described by ‘number of flagbytes’, is defined as:%0bcd0000Each flag that is set in the extended header has data attached, whichcomes in the order in which the flags are encountered (i.e. the datafor flag ‘b’ comes before the data for flag ‘c’). Unset flags cannothave any attached data. All unknown flags MUST be unset and theircorresponding data removed when a tag is modified.Every set flag’s data starts with a length byte, which contains avalue between 0 and 128 ($00 – $7f), followed by data that has thefield length indicated by the length byte. If a flag has no attacheddata, the value $00 is used as length byte.b – Tag is an updateIf this flag is set, the present tag is an update of a tag foundearlier in the present file or stream. If frames defined as uniqueare found in the present tag, they are to override anycorresponding ones found in the earlier tag. This flag has nocorresponding data.Flag data length $00c – CRC data presentIf this flag is set, a CRC-32 [ISO-3309] data is included in theextended header. The CRC is calculated on all the data between theheader and footer as indicated by the header’s tag length field,minus the extended header. Note that this includes the padding (ifthere is any), but excludes the footer. The CRC-32 is stored as an35 bit synchsafe integer, leaving the upper four bits alwayszeroed.Flag data length $05Total frame CRC 5 * %0xxxxxxxd – Tag restrictionsFor some applications it might be desired to restrict a tag in moreways than imposed by the ID3 tag manager specification. Note that thepresence of these restrictions does not affect how the tag isdecoded, merely how it was restricted before encoding. If this flagis set the tag is restricted as follows:Flag data length $01Restrictions %ppqrrsttp – Tag size restrictions00 No more than 128 frames and 1 MB total tag size.01 No more than 64 frames and 128 KB total tag size.10 No more than 32 frames and 40 KB total tag size.11 No more than 32 frames and 4 KB total tag size.q – Text encoding restrictions0 No restrictions1 Strings are only encoded with ISO-8859-1 [ISO-8859-1] orUTF-8 [UTF-8].r – Text fields size restrictions00 No restrictions01 No string is longer than 1024 characters.10 No string is longer than 128 characters.11 No string is longer than 30 characters.Note that nothing is said about how many bytes is used torepresent those characters, since it is encoding dependent. If atext frame consists of more than one string, the sum of thestrungs is restricted as stated.s – Image encoding restrictions0 No restrictions1 Images are encoded only with PNG [PNG] or JPEG [JFIF].t – Image size restrictions00 No restrictions01 All images are 256×256 pixels or smaller.10 All images are 64×64 pixels or smaller.11 All images are exactly 64×64 pixels, unless requiredotherwise.3.3. PaddingIt is OPTIONAL to include padding after the final frame (at the endof the ID3 tag), making the size of all the frames together smallerthan the size given in the tag header. A possible purpose of thispadding is to allow for adding a few additional frames or enlargeexisting frames within the tag without having to rewrite the entirefile. The value of the padding bytes must be $00. A tag MUST NOT haveany padding between the frames or between the tag header and theframes. Furthermore it MUST NOT have any padding when a tag footer isadded to the tag.3.4. ID3 tag manager footerTo speed up the process of locating an ID3 tag manager tag when searching fromthe end of a file, a footer can be added to the tag. It is REQUIREDto add a footer to an appended tag, i.e. a tag located after allaudio data. The footer is a copy of the header, but with a differentidentifier.ID3 tag manager identifier “3DI” ID3 tag manager version $04 00ID3 tag manager flags %abcd0000ID3 tag manager size 4 * %0xxxxxxx4. ID3 tag manager frame overviewAll ID3 tag manager frames consists of one frame header followed by one or morefields containing the actual information. The header is always 10bytes and laid out as follows:Frame ID $xx xx xx xx (four characters)Size 4 * %0xxxxxxxFlags $xx xxThe frame ID is made out of the characters capital A-Z and 0-9.Identifiers beginning with “X”, “Y” and “Z” are for experimentalframes and free for everyone to use, without the need to set theexperimental bit in the tag header. Bear in mind that someone elsemight have used the same identifier as you. All other identifiers areeither used or reserved for future use.The frame ID is followed by a size descriptor containing the size ofthe data in the final frame, after encryption, compression andunsynchronisation. The size is excluding the frame header (‘totalframe size’ – 10 bytes) and stored as a 32 bit synchsafe integer.In the frame header the size descriptor is followed by two flagbytes. These flags are described in section 4.1.There is no fixed order of the frames’ appearance in the tag,although it is desired that the frames are arranged in order ofsignificance concerning the recognition of the file. An example ofsuch order: UFID, TIT2, MCDI, TRCK …A tag MUST contain at least one frame. A frame must be at least 1byte big, excluding the header.If nothing else is said, strings, including numeric strings and URLs are represented as ISO-8859-1 [ISO-8859-1] characters in therange $20 – $FF. Such strings are represented in frame descriptionsas <text string>, or <full text string> if newlines are allowed. Ifnothing else is said newline character is forbidden. In ISO-8859-1 anewline is represented, when allowed, with $0A only.Frames that allow different types of text encoding contains a textencoding description byte. Possible encodings:$00 ISO-8859-1 [ISO-8859-1]. Terminated with $00.$01 UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM. Allstrings in the same frame SHALL have the same byteorder.Terminated with $00 00.$02 UTF-16BE [UTF-16] encoded Unicode [UNICODE] without BOM.Terminated with $00 00.$03 UTF-8 [UTF-8] encoded Unicode [UNICODE]. Terminated with $00.Strings dependent on encoding are represented in frame descriptionsas <text string according to encoding>, or <full text stringaccording to encoding> if newlines are allowed. Any empty strings oftype $01 which are NULL-terminated may have the Unicode BOM followedby a Unicode NULL ($FF FE 00 00 or $FE FF 00 00).The timestamp fields are based on a subset of ISO 8601. When being asprecise as possible the format of a time string isyyyy-MM-ddTHH:mm:ss (year, “
”, month, “”, day, “T, hour (out of24),, minutes, ”:”, seconds), but the precision may be reduced byremoving as many time indicators as wanted. Hence valid timestampsareyyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm andyyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, usethe slash character as described in 8601, and for multiple noncontiguousdates, use multiple strings, if allowed by the framedefinition.The three byte language field, present in several frames, is used todescribe the language of the frame’s content, according to ISO-639-2 The language should be represented in lower case. If thelanguage is not known the string “XXX” should be used.All URLs [URL] MAY be relative, e.g. “picture.png”, ”../doc.txt”.If a frame is longer than it should be, e.g. having more fields thanspecified in this document, that indicates that additions to theframe have been made in a later version of the ID3 tag manager standard. Thisis reflected by the revision number in the header of the tag.4.1. Frame header flagsIn the frame header the size descriptor is followed by two flagbytes. All unused flags MUST be cleared. The first byte is for‘status messages’ and the second byte is a format description. If anunknown flag is set in the first byte the frame MUST NOT be changedwithout that bit cleared. If an unknown flag is set in the secondbyte the frame is likely to not be readable. Some flags in the secondbyte indicates that extra information is added to the header. Thesefields of extra information is ordered as the flags that indicatesthem. The flags field is defined as follows (l and o left out becausether resemblence to one and zero):%0abc0000 %0h00kmnpSome frame format flags indicate that additional information fieldsare added to the frame. This information is added after the frameheader and before the frame data in the same order as the flags thatindicates them. I.e. the four bytes of decompressed size will precedethe encryption method byte. These additions affects the ‘frame size’field, but are not subject to encryption or compression.The default status flags setting for a frame is, unless statedotherwise, ‘preserved if tag is altered’ and ‘preserved if file isaltered’, i.e. %00000000.4.1.1. Frame status flagsa – Tag alter preservationThis flag tells the tag parser what to do with this frame if it isunknown and the tag is altered in any way. This applies to allkinds of alterations, including adding more padding and reorderingthe frames.0 Frame should be preserved.1 Frame should be discarded.b – File alter preservationThis flag tells the tag parser what to do with this frame if it isunknown and the file, excluding the tag, is altered. This does notapply when the audio is completely replaced with other audio data.0 Frame should be preserved.1 Frame should be discarded.c – Read onlyThis flag, if set, tells the software that the contents of thisframe are intended to be read only. Changing the contents mightbreak something, e.g. a signature. If the contents are changed,without knowledge of why the frame was flagged read only andwithout taking the proper means to compensate, e.g. recalculatingthe signature, the bit MUST be cleared.4.1.2. Frame format flagsh – Grouping identityThis flag indicates whether or not this frame belongs in a groupwith other frames. If set, a group identifier byte is added to theframe. Every frame with the same group identifier belongs to thesame group.0 Frame does not contain group information1 Frame contains group informationk – CompressionThis flag indicates whether or not the frame is compressed.A ‘Data Length Indicator’ byte MUST be included in the frame.0 Frame is not compressed.1 Frame is compressed using zlib [zlib] deflate method.If set, this requires the ‘Data Length Indicator’ bitto be set as well.m – EncryptionThis flag indicates whether or not the frame is encrypted. If set,one byte indicating with which method it was encrypted will beadded to the frame. See description of the ENCR frame for moreinformation about encryption method registration. Encryptionshould be done after compression. Whether or not setting this flagrequires the presence of a ‘Data Length Indicator’ depends on thespecific algorithm used.0 Frame is not encrypted.1 Frame is encrypted.n – UnsynchronisationThis flag indicates whether or not unsynchronisation was appliedto this frame. See section 6 for details on unsynchronisation.If this flag is set all data from the end of this header to theend of this frame has been unsynchronised. Although desirable, thepresence of a ‘Data Length Indicator’ is not made mandatory byunsynchronisation.0 Frame has not been unsynchronised.1 Frame has been unsyrchronised.p – Data length indicatorThis flag indicates that a data length indicator has been added tothe frame. The data length indicator is the value one would writeas the ‘Frame length’ if all of the frame format flags werezeroed, represented as a 32 bit synchsafe integer.0 There is no Data Length Indicator.1 A data length Indicator has been added to the frame.5. Tag locationThe default location of an ID3 tag manager tag is prepended to the audio sothat players can benefit from the information when the data isstreamed. It is however possible to append the tag, or make aprepend/append combination. When deciding upon where an unembeddedtag should be located, the following order of preference SHOULD beconsidered.1. Prepend the tag.2. Prepend a tag with all vital information and add a second tagatthe end of the file, before tags from other tagging systems. Thefirst tag is required to have a SEEK frame.3. Add a tag at the end of the file, before tags from other taggingsystems.In case 2 and 3 the tag can simply be appended if no other known tagsare present. The suggested method to find ID3 tag manager tags are:1. Look for a prepended tag using the pattern found in section 3.1.2. If a SEEK frame was found, use its values to guide furthersearching.3. Look for a tag footer, scanning from the back of the file.For every new tag that is found, the old tag should be discardedunless the update flag in the extended header (section 3.2) is set.6. UnsynchronisationThe only purpose of unsynchronisation is to make the ID3 tag manager tag ascompatible as possible with existing software and hardware. There isno use in ‘unsynchronising’ tags if the file is only to be processedonly by ID3 tag manager aware software and hardware. Unsynchronisation is onlyuseful with tags in MPEG 1/2 layer I, II and III, MPEG 2.5 and AACfiles.6.1. The unsynchronisation schemeWhenever a false synchronisation is found within the tag, one zeroedbyte is inserted after the first false synchronisation byte. Theformat of synchronisations that should be altered by ID3 encoders isas follows:%11111111 111xxxxxand should be replaced with:%11111111 00000000 111xxxxxThis has the side effect that all $FF 00 combinations have to bealtered, so they will not be affected by the decoding process.Therefore all the $FF 00 combinations have to be replaced with the$FF 00 00 combination during the unsynchronisation.To indicate usage of the unsynchronisation, the unsynchronisationflag in the frame header should be set. This bit MUST be set if theframe was altered by the unsynchronisation and SHOULD NOT be set ifunaltered. If all frames in the tag are unsynchronised theunsynchronisation flag in the tag header SHOULD be set. It MUST NOTbe set if the tag has a frame which is not unsynchronised.Assume the first byte of the audio to be $FF. The special case whenthe last byte of the last frame is $FF and no padding nor footer isused will then introduce a false synchronisation. This can be solvedby adding a footer, adding padding or unsynchronising the frame andadd $00 to the end of the frame data, thus adding more byte to theframe size than a normal unsynchronisation would. Although notpreferred, it is allowed to apply the last method on all framesending with $FF.It is preferred that the tag is either completely unsynchronised ornot unsynchronised at all. A completely unsynchronised tag has nofalse synchonisations in it, as defined above, and does not end with$FF. A completely non-unsynchronised tag contains no unsynchronisedframes, and thus the unsynchronisation flag in the header is cleared.Do bear in mind, that if compression or encryption is used, theunsynchronisation scheme MUST be applied afterwards. When decoding anunsynchronised frame, the unsynchronisation scheme MUST be reversedfirst, encryption and decompression afterwards.6.2. Synchsafe integersIn some parts of the tag it is inconvenient to use theunsychronisation scheme because the size of unsynchronised data isnot known in advance, which is particularly problematic with sizedescriptors. The solution in ID3 tag manager is to use synchsafe integers, inwhich there can never be any false synchs. Synchsafe integers areintegers that keep its highest bit (bit 7) zeroed, making seven bitsout of eight available. Thus a 32 bit synchsafe integer can store 28bits of information.Example:255 (%11111111) encoded as a 16 bit synchsafe integer is 383(%00000001 01111111).