APE Tags Header

From Hydrogenaudio Knowledgebase

APE Tag Header/Footer Version 2.0

Contains number, length and attributes of all tag items

Header and Footer are different in 1 bit in the Tags Flags to distinguish between them.

Member of APE Tag 2.0

Preamble 64 bits { 'A', 'P', 'E', 'T', 'A', 'G', 'E', 'X' }

Version Number, Bits 0...7
Version Number, Bits 8...15
Version Number, Bits 16...23
Version Number, Bits 24...31

32 bits

1000 = Version 1.000 (old)
2000 = Version 2.000 (new)

Tag Size, Bits 0... 7
Tag Size, Bits 8...15
Tag Size, Bits 16...23
Tag Size, Bits 24...31

32 bits Tag size in bytes including footer and all tag items excluding the header to be as compatible as possible with APE Tags 1.000

Item Count, Bits 0... 7
Item Count, Bits 8...15
Item Count, Bits 16...23
Item Count, Bits 24...31

32 bits Number of items in the Tag (n)

Tags Flags, Bits 0... 7
Tags Flags, Bits 8...15
Tags Flags, Bits 16...23
Tags Flags, Bits 24...31

32 bits

Global flags of all items
(there are also private flags for every item)

Reserved 64 bits Must be zero