The chan chunk gives each channel a meaning. It is required when a file has
more than two channels and their order matters. Without one, a mono file is one channel
and a stereo file is left then right.
Fields
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | mChannelLayoutTag | the layout, below |
| 4 | 4 | u32 | mChannelBitmap | used with the bitmap tag |
| 8 | 4 | u32 | mNumberChannelDescriptions | the number of descriptions that follow |
| 12 | 20 each | record | mChannelDescriptions | used with the descriptions tag |
A channel description:
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | mChannelLabel | a label |
| 4 | 4 | u32 | mChannelFlags | how to read the coordinates, below |
| 8 | 12 | f32[3] | mCoordinates | the speaker’s position, with label 100 |
| Flag | Constant |
|---|---|
| 0 | kCAFChannelFlags_AllOff |
| bit 0 | kCAFChannelFlags_RectangularCoordinates |
| bit 1 | kCAFChannelFlags_SphericalCoordinates |
| bit 2 | kCAFChannelFlags_Meters |
Channel bitmap
With the bitmap tag, each set bit in mChannelBitmap is one channel, in
order from the lowest bit up. The WAV column gives WAV’s name for the same speaker,
where Apple’s specification notes one.
| Bit | Constant (after kCAFChannelBit_) | WAV name |
|---|---|---|
| 0 | Left | |
| 1 | Right | |
| 2 | Center | |
| 3 | LFEScreen | |
| 4 | LeftSurround | Back Left |
| 5 | RightSurround | Back Right |
| 6 | LeftCenter | |
| 7 | RightCenter | |
| 8 | CenterSurround | Back Center |
| 9 | LeftSurroundDirect | Side Left |
| 10 | RightSurroundDirect | Side Right |
| 11 | TopCenterSurround | |
| 12 | VerticalHeightLeft | Top Front Left |
| 13 | VerticalHeightCenter | Top Front Center |
| 14 | VerticalHeightRight | Top Front Right |
| 15 | TopBackLeft | |
| 16 | TopBackCenter | |
| 17 | TopBackRight |
Channel labels
| Value | Constant (after kCAFChannelLabel_) | Note |
|---|---|---|
0xFFFFFFFF | Unknown | |
| 0 | Unused | |
| 100 | UseCoordinates | the position is in mCoordinates |
| 1 | Left | |
| 2 | Right | |
| 3 | Center | |
| 4 | LFEScreen | |
| 5 | LeftSurround | WAV: Back Left |
| 6 | RightSurround | WAV: Back Right |
| 7 | LeftCenter | |
| 8 | RightCenter | |
| 9 | CenterSurround | WAV: Back Center, or plain Rear Surround |
| 10 | LeftSurroundDirect | WAV: Side Left |
| 11 | RightSurroundDirect | WAV: Side Right |
| 12 | TopCenterSurround | |
| 13 | VerticalHeightLeft | WAV: Top Front Left |
| 14 | VerticalHeightCenter | WAV: Top Front Center |
| 15 | VerticalHeightRight | WAV: Top Front Right |
| 16 | TopBackLeft | |
| 17 | TopBackCenter | |
| 18 | TopBackRight | |
| 33 | RearSurroundLeft | |
| 34 | RearSurroundRight | |
| 35 | LeftWide | |
| 36 | RightWide | |
| 37 | LFE2 | |
| 38 | LeftTotal | matrix encoded |
| 39 | RightTotal | matrix encoded |
| 40 | HearingImpaired | |
| 41 | Narration | |
| 42 | Mono | |
| 43 | DialogCentricMix | |
| 44 | CenterSurroundDirect | back centre, not diffuse |
| 200 | Ambisonic_W | |
| 201 | Ambisonic_X | |
| 202 | Ambisonic_Y | |
| 203 | Ambisonic_Z | |
| 204 | MS_Mid | |
| 205 | MS_Side | |
| 206 | XY_X | |
| 207 | XY_Y | |
| 301 | HeadphonesLeft | |
| 302 | HeadphonesRight | |
| 304 | ClickTrack | |
| 305 | ForeignLanguage |