AudioChannelLayout - What's the Audio Channel Order when the Layout has a Channel Bitmap?

Q: My multichannel QuickTime audio Track has an AudioChannelLayout with a channel bitmap. The mChannelLayoutTag is kAudioChannelLayoutTag_UseChannelBitmap and the mChannelBitmap field contains the value 0x3F-- Left, Right, Center, LFEScreen, LeftSurround, RightSurround. How do I know what order these channels appear in the audio buffer?

A: If an AudioChannelLayout has a bitmap, there is only one order the channels present can be in. This order is commonly known as USB order and is the same order the bits are defined in the Channel Bitmap Constants enumeration, see CoreAudio/CoreAudioTypes.h.

/*!
    @enum           Channel Bitmap Constants
    @abstract       These constants are for use in the mChannelBitmap field of an
                    AudioChannelLayout structure.
*/
enum
{
    kAudioChannelBit_Left                       = (1L<<0),
    kAudioChannelBit_Right                      = (1L<<1),
    kAudioChannelBit_Center                     = (1L<<2),
    kAudioChannelBit_LFEScreen                  = (1L<<3),
    kAudioChannelBit_LeftSurround               = (1L<<4),
    kAudioChannelBit_RightSurround              = (1L<<5),

...
};

Therefore, in the bitmap described above, the first channel is Left, then Right, then Center, then LFE, then Left Surround and finally Right Surround.

Note: This is not specific to QuickTime. Anytime you encounter an audio channel layout with a bitmap, the bitmap tells you the channels present as well as the order.

Document Revision History

Date Notes
2009-04-12 First Version

Posted: 2009-04-12


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.