The chna chunk (channel allocation) ties each track of the audio to the
Audio Definition Model (ADM, ITU-R BS.2076) metadata held as XML in an
axml chunk.
The ADM says what each track is, such as a channel of a 5.1 mix or a moving object, and
the chna chunk says which track in the file is which. EBU Tech 3285
supplement 7 defines it for Broadcast Wave files, and ITU-R BW64 uses the same chunk; the
explorer reads it in RF64 files too.
Fields
Offsets are from the start of the chunk’s data. Numbers are little-endian. The chunk is small, so its 32-bit size is always its real size.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | numTracks | the number of tracks used: the number of different trackIndex values |
| 2 | 2 | u16 | numUIDs | the number of track UIDs used |
| 4 | 40 each | record | audioID | one entry for each track UID, laid out below |
The chunk can be made larger than it needs, with unused entries at the end left as
zeros, so a writer can fill it in later without moving anything. Supplement 7 places it
before the data and axml chunks. The explorer reports a
numUIDs larger than the entries that fit.
audioID
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | trackIndex | the track in the data, counting from 1; libbw64 refuses 0, and an unused entry is zero |
| 2 | 12 | char[12] | UID | the audioTrackUID in the ADM metadata, such as ATU_00000001 |
| 14 | 14 | char[14] | trackRef | the audioTrackFormatID it refers to, such as AT_00010001_01 |
| 28 | 11 | char[11] | packRef | the audioPackFormatID, such as AP_00010002 |
| 39 | 1 | u8 | pad | a pad byte; libbw64 writes a space |
Several entries can name the same track, which is why numTracks and
numUIDs can differ. An example built for this page, with one entry:
00000000 63 68 6E 61 2C 00 00 00 01 00 01 00 01 00 41 54 chna,.........AT
00000010 55 5F 30 30 30 30 30 30 30 31 41 54 5F 30 30 30 U_00000001AT_000
00000020 31 30 30 30 31 5F 30 31 41 50 5F 30 30 30 31 30 10001_01AP_00010
00000030 30 30 32 20 002