Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Core Audio Data Types Reference

Framework
CoreAudio/CoreAudio.h
Declared in
CoreAudioTypes.h

Overview

Important: This is a preliminary document. Although it has been reviewed for technical accuracy, it is not final. Apple Computer is supplying this information to help you plan for the adoption of the technologies and programming interfaces described herein. This information is subject to change, and software implemented according to this document should be tested with final operating system software and final documentation. For information about updates to this and other developer documentation, you can check the ADC Reference Library Revision List. To receive notification of documentation updates, you can sign up for a free Apple Developer Connection Online membership and receive the bi-weekly ADC News e-mail newsletter. (See http://developer.apple.com/membership/ for more details about ADC membership.)

This document lists and describes data types and constants used throughout the Core Audio API.

Functions by Task

Testing for Native Endian Linear PCM Data

Getting the Number of Channels From a Layout Tag.

Functions

AudioChannelLayoutTag_GetNumberOfChannels

A macro to get the number of channels from an audio channel layout tag (AudioChannelLayoutTag data type).

#define AudioChannelLayoutTag_GetNumberOfChannels(layoutTag) ((UInt32)((layoutTag) & 0x0000FFFF))

Parameters
layoutTag

The audio channel layout tag to examine.

Return Value

The number of channels the tag indicates.

Discussion

The low 16 bits of an audio channel layout tag gives the number of channels, unless the layout tag is kAudioChannelLayoutTag_UseChannelDescriptions or kAudioChannelLayoutTag_UseChannelBitmap, which specify other ways of defining the layout.

Availability
Declared In
CoreAudioTypes.h

IsAudioFormatNativeEndian

A C++ inline function for checking if an AudioFormatBasicDescription structure indicates native endian linear PCM data.

#if defined(__cplusplus)
   inline bool IsAudioFormatNativeEndian(const AudioStreamBasicDescription& f) { return (f.mFormatID == kAudioFormatLinearPCM) && ((f.mFormatFlags & kAudioFormatFlagIsBigEndian) == kAudioFormatFlagsNativeEndian); }
#endif

Parameters
f

The AudioFormatBasicDescription structure you want to examine.

Return Value

A Boolean indicating whether the AudioFormatBasicDescription structure indicates native endian linear PCM data. True if the data is linear PCM and is native endian.

Availability
Declared In
CoreAudioTypes.h

TestAudioFormatNativeEndian

A macro for checking if an AudioFormatBasicDescription structure indicates native endian linear PCM data.

#define TestAudioFormatNativeEndian(f)  ((f.mFormatID == kAudioFormatLinearPCM) && ((f.mFormatFlags & kAudioFormatFlagIsBigEndian) == kAudioFormatFlagsNativeEndian))

Parameters
f

The AudioFormatBasicDescription structure you want to examine.

Return Value

True if the data is linear PCM and is native endian.

Availability
Declared In
CoreAudioTypes.h

Data Types

AudioValueRange

Holds a pair of numbers that represent a continuous range of values.

struct AudioValueRange
   {
   Float64 mMinimum;
   Float64 mMaximum;
};
typedef struct AudioValueRange AudioValueRange;

Fields
mMinimum

The minimum value.

mMaximum

The maximum value.

Availability
Declared In
CoreAudioTypes.h

AudioValueTranslation

Holds the buffers necessary for translation operations.

struct AudioValueTranslation
   {
   void*   mInputData;
   UInt32  mInputDataSize;
   void*   mOutputData;
   UInt32  mOutputDataSize;
};
typedef struct AudioValueTranslation AudioValueTranslation;

Fields
mInputData

The buffer containing the data to be translated.

mInputDataSize

The number of bytes in the buffer pointed at by mInputData.

mOutputData

The buffer to hold the result of the translation.

mOutputDataSize

The number of bytes in the buffer pointed at by mOutputData.

Availability
Declared In
CoreAudioTypes.h

AudioBuffer

Holds a buffer of audio data.

struct AudioBuffer
   {
   UInt32  mNumberChannels;
   UInt32  mDataByteSize;
   void*   mData;
};
typedef struct AudioBuffer  AudioBuffer;

Fields
mNumberChannels

The number of interleaved channels in the buffer.

mDataByteSize

The number of bytes in the buffer pointed at by mData.

mData

A pointer to the buffer of audio data.

Availability
Declared In
CoreAudioTypes.h

AudioBufferList

Holds a variable length array of AudioBuffer structures.

struct AudioBufferList
   {
   UInt32      mNumberBuffers;
   AudioBuffer mBuffers[kVariableLengthArray];
};
typedef struct AudioBufferList  AudioBufferList;

Fields
mNumberBuffers

The number of AudioBuffer structures in the mBuffers array.

mBuffers

A variable length array of AudioBuffer structures.

Availability
Declared In
CoreAudioTypes.h

AudioStreamBasicDescription

Encapsulates all the information for describing the basic format properties of a stream of audio data.

struct AudioStreamBasicDescription
   {
   Float64 mSampleRate;
   UInt32  mFormatID;
   UInt32  mFormatFlags;
   UInt32  mBytesPerPacket;
   UInt32  mFramesPerPacket;
   UInt32  mBytesPerFrame;
   UInt32  mChannelsPerFrame;
   UInt32  mBitsPerChannel;
   UInt32  mReserved;
};
typedef struct AudioStreamBasicDescription  AudioStreamBasicDescription;

Fields
mSampleRate

The number of sample frames per second of the data in the stream. For compressed formats, this field indicates the number of sample frames per second of decompressed data. You can combine this value with the frames per packet to determine the amount of time represented by a packet. This value must be nonzero, except when this structure is used in a listing of supported formats (see AudioStreamBasicDescription Constant).

mFormatID

A four character code indicating the general kind of data in the stream. See Audio Data Format IDs. This value must be nonzero.

mFormatFlags

Flags specific to each format, if any. My be set to 0 to indicate no format flags. See Audio Data Format IDs for the types of flags used with each data type.

mBytesPerPacket

The number of bytes in a packet of data. For formats with a variable packet size, this field is set to 0. In that case, the size of each packet is specified by an AudioStreamPacketDescription structure.

mFramesPerPacket

The number of sample frames in each packet of data. For compressed formats, this field indicates the number of frames encoded in each packet. For formats with a variable number of frames per packet, this field is set to 0 and the packet is described by an AudioStreamPacketDescription structure.

mBytesPerFrame

The number of bytes in a single sample frame of data. This field is set to 0 if the data format (for instance any compressed format) does not contain separate samples for each channel.

mChannelsPerFrame

The number of channels in each frame of data. This value must be nonzero.

mBitsPerChannel

The number of bits of sample data for each channel in a frame of data. This field is set to 0 if the data format (for instance any compressed format) does not contain separate samples for each channel.

mReserved

Pads the structure out to force an even 8-byte alignment.

Discussion

This structure is sufficient to describe any constant bit rate format that has channels that are the same size. For variable bit rate data and for constant bit rate data where the channels have unequal sizes, each packet must additionally be described by an AudioStreamPacketDescription structure. In all fields, a value of 0 indicates that the field is either unknown, not applicable, or otherwise is inappropriate for the format and should be ignored.

For the purposes of this data structure, the following definitions apply:

Typically, the fields of an AudioStreamBasicDescription structure describe the complete layout of the sample data in data buffers represented by AudioBuffer structures that are contained in an AudioBufferList structure.

When an AudioStreamBasicDescription structure has the kAudioFormatFlagIsNonInterleaved flag set, however, the AudioBufferList structure is used in a different way. In this case, each AudioBuffer structure in the list contains a single (mono) channel of audio data and the AudioStreamBasicDescription structure fields describe the format of one AudioBuffer structure. The exception to this rule is the AudioStreamBasicDescription structure’s mChannelsPerFrame field, which indicates the total number of AudioBuffer structures that are contained in the AudioBufferList. This data format is used primarily by audio units and audio converters. It is not used by audio hardware.

Availability
Declared In
CoreAudioTypes.h

AudioStreamPacketDescription

Used to describe one packet in a buffer of data where the sizes of the packets differ or where there is extraneous data between packets.

struct  AudioStreamPacketDescription
   {
   SInt64  mStartOffset;
   UInt32  mVariableFramesInPacket;
   UInt32  mDataByteSize;
};
typedef struct AudioStreamPacketDescription AudioStreamPacketDescription;

Fields
mStartOffset

The number of bytes from the start of the buffer to the beginning of the packet. For example, if the data buffer contains 5 bytes of data, with one byte per packet, then mStartOffset for the last packet is 4 (that is, there are 4 bytes in the buffer before the start of the last packet.

mVariableFramesInPacket

The number of sample frames of data in the packet. For formats with a constant number of frames per packet, this field is set to 0.

mDataByteSize

The number of bytes in the packet.

Discussion

For data formats where the packet size is not constant, such as variable bit rate data and data where the channels have unequal sizes, this structure is used to supplement the information in the AudioStreamBasicDescription structure.

Availability
Declared In
CoreAudioTypes.h

SMPTETime

Holds a time in one of the SMPTE time types.

struct SMPTETime
   {
   SInt16  mSubframes;
   SInt16  mSubframeDivisor;
   UInt32  mCounter;
   UInt32  mType;
   UInt32  mFlags;
   SInt16  mHours;
   SInt16  mMinutes;
   SInt16  mSeconds;
   SInt16  mFrames;
};
typedef struct SMPTETime    SMPTETime;

Fields
mSubframes

A subframe offset to the HH:MM:SS:FF time. You can use this field to position a time marker somewhere within the time span represented by a video frame, if necessary.

mSubframeDivisor

The number of subframes per video frame (typically 80).

mCounter

The total number of messages received. It takes 8 messages to carry a full SMPTE time code.

mType

A SMPTE time type constant indicating the kind of SMPTE time used (see SMPTE Time Type Constants).

mFlags

A set of flags that indicate the SMPTE state (see SMPTE State Flags).

mHours

The value of the hours portion of the SMPTE time.

mMinutes

The value of the minutes portion of the SMPTE time.

mSeconds

The value of the seconds portion of the SMPTE time.

mFrames

The value of the frames portion of the SMPTE time.

Discussion

SMPTE (Society of Motion Picture and Television Engineers, pronounced “SIMPtee”) times are used to correlate a point in an audio stream with an external event. For example, a SMPTE time can be used to correlate a sound in an audio file with a video frame in a movie file.

Note that the frames referred to by this structure are video frames, where a video frame is a single complete image. (Compare with the definition of audio frames in the discussion for AudioStreamBasicDescription.)

A complete SMPTE time description takes 80 bits, including 32 user bits that contain vendor-specific information. The actual time-code portion of the SMPTE time description is normally sent in several messages, each message containing a portion of the time code. (The user bits are sent in a separate message.) Typically, the SMPTE time description is divided up into 8 1-byte messages, with the first nibble of each message specifying which portion of the time code is contained in the message and the second nibble containing the time information. Four such messages are normally sent with each video frame.

Video data contains somewhere from 24 to 60 frames per second (as specified by the SMPTE time type—see SMPTE Time Type Constants) and each video frame has an associated SMPTE time. SMPTE time is based on a 24-hour clock. Each frame’s SMPTE time consists of an hour, minute, and second value, plus the number of the frame within the second. Because audio data is sampled at a much higher rate (MP3 data is sampled at over 100,000 bits per second, for example), it is frequently desirable to correlate the audio data with a time within the persistence period of a single video frame. For this reason, the time period during which a single video frame is displayed is subdivided into subframes (typically 80 or 100 subframes per frame, as specified by the mSubFrameDivisor field). The mSubFrames field specifies the number of subframes into the video frame represented by this time structure.

Availability
Declared In
CoreAudioTypes.h

AudioTimeStamp

Holds different representations of the same time.

struct AudioTimeStamp
   {
   Float64         mSampleTime;
   UInt64          mHostTime;
   Float64         mRateScalar;
   UInt64          mWordClockTime;
   SMPTETime       mSMPTETime;
   UInt32          mFlags;
   UInt32          mReserved;
};
typedef struct AudioTimeStamp   AudioTimeStamp;

Fields
mSampleTime

The absolute sample frame time.

mHostTime

The host machine's time base (see CoreAudio/HostTime.h).

mRateScalar

The ratio of actual host ticks per sample frame to the nominal host ticks per sample frame.

mWordClockTime

The word clock time.

mSMPTETime

The SMPTE time (see SMPTETime).

mFlags

A set of flags indicating which representations of the time are valid; see Audio Time Stamp Flags and Audio Time Stamp Flag Combination Constant.

mReserved

Pads the structure out to force an even 8-byte alignment.

Availability
Declared In
CoreAudioTypes.h

AudioClassDescription

Used to describe codecs installed on the system.

struct AudioClassDescription {
   OSType  mType;
   OSType  mSubType;
   OSType  mManufacturer;
};
typedef struct AudioClassDescription    AudioClassDescription;

Fields
mType

The four character code for the codec type. Defined by the codec manufacturer.

mSubType

The four character code for the codec subtype. Defined by the codec manufacturer.

mManufacturer

The four character code for the codec manufacturer. This must be a unique code registered with Apple.

Availability
Declared In
CoreAudioTypes.h

AudioChannelLabel

A tag identifying how the channel is to be used.

typedef UInt32 AudioChannelLabel;

Discussion

This data type is used for the mChannelLabel field of the AudioChannelDescription structure. See Audio Channel Label Constants for possible values.

Availability
Declared In
CoreAudioTypes.h

AudioChannelLayoutTag

A tag identifying a particular pre-defined channel layout.

typedef UInt32 AudioChannelLayoutTag;

Discussion

This data type is used for the mChannelLayoutTag field of the AudioChannelLayout structure. See Audio Channel Layout Tags for possible values.

Availability
Declared In
CoreAudioTypes.h

AudioChannelDescription

Describes a single channel.

struct AudioChannelDescription
   {
   AudioChannelLabel   mChannelLabel;
   UInt32              mChannelFlags;
   Float32             mCoordinates[3];
};
typedef struct AudioChannelDescription AudioChannelDescription;

Fields
mChannelLabel

The AudioChannelLabel structure that describes the channel.

mChannelFlags

Flags that control the interpretation of mCoordinates. See Channel Coordinate Flags for possible values.

mCoordinates

An ordered triple that specifies a precise speaker location. See Channel Coordinate Index Constants for the interpretation of the items in the array.

Availability
Declared In
CoreAudioTypes.h

AudioChannelLayout

Used to specify channel layouts in files and hardware.

struct AudioChannelLayout
   {
   AudioChannelLayoutTag       mChannelLayoutTag;
   UInt32                      mChannelBitmap;
   UInt32                      mNumberChannelDescriptions;
   AudioChannelDescription     mChannelDescriptions[kVariableLengthArray];
};
typedef struct AudioChannelLayout AudioChannelLayout;

Fields
mChannelLayoutTag

The AudioChannelLayoutTag value that indicates the layout. See Audio Channel Layout Tags for possible values.

mChannelBitmap

If mChannelLayoutTag is set to kAudioChannelLayoutTag_UseChannelBitmap, this field is the channel use bitmap.

mNumberChannelDescriptions

The number of items in the mChannelDescriptions array.

mChannelDescriptions

If mChannelLayoutTag is set to kAudioChannelLayoutTag_UseChannelDescriptions, use the mChannelDescriptions field to describe the layout.

Availability
Declared In
CoreAudioTypes.h

Constants

AudioStreamBasicDescription Constant

A constant for use with the AudioStreamBasicDescription structure.

enum
{
   kAudioStreamAnyRate = 0
};

Constants
kAudioStreamAnyRate

The format can use any sample rate. Note that this constant can only appear in listings of supported formats. It can never be used as part of the description of a current format.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

Audio Data Format IDs

The four character code IDs used to identify individual formats of audio data in the AudioStreamBasicDescription structure.

enum
{
   kAudioFormatLinearPCM               = 'lpcm',
   kAudioFormatAC3                     = 'ac-3',
   kAudioFormat60958AC3                = 'cac3',
   kAudioFormatAppleIMA4               = 'ima4',
   kAudioFormatMPEG4AAC                = 'aac ',
   kAudioFormatMPEG4CELP               = 'celp',
   kAudioFormatMPEG4HVXC               = 'hvxc',
   kAudioFormatMPEG4TwinVQ             = 'twvq',
   kAudioFormatMACE3                   = 'MAC3',
   kAudioFormatMACE6                   = 'MAC6',
   kAudioFormatULaw                    = 'ulaw',
   kAudioFormatALaw                    = 'alaw',
   kAudioFormatQDesign                 = 'QDMC',
   kAudioFormatQDesign2                = 'QDM2',
   kAudioFormatQUALCOMM                = 'Qclp',
   kAudioFormatMPEGLayer1              = '.mp1',
   kAudioFormatMPEGLayer2              = '.mp2',
   kAudioFormatMPEGLayer3              = '.mp3',
   kAudioFormatDVAudio                 = 'dvca',
   kAudioFormatVariableDurationDVAudio = 'vdva',
   kAudioFormatTimeCode                = 'time',
   kAudioFormatMIDIStream              = 'midi',
   kAudioFormatParameterValueStream    = 'apvs',
   kAudioFormatAppleLossless           = 'alac'
};

Constants
kAudioFormatLinearPCM

Linear PCM, a noncompressed audio data format with one frame per packet. Uses the linear PCM format flags in AudioStreamBasicDescription Flags.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kAudioFormatAC3

AC-3. Uses no flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormat60958AC3

AC-3 packaged for transport over an IEC 60958 compliant digital audio interface. Uses the standard format flags in AudioStreamBasicDescription Flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatAppleIMA4

Apple’s implementation of IMA 4:1 ADPCM. Uses no flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEG4AAC

MPEG-4 AAC. The flags field contains the MPEG-4 audio object type constant listed in MPEG-4 Audio Object Type Constants indicating the specific kind of data.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEG4CELP

MPEG-4 CELP. The flags field contains the MPEG-4 audio object type constant listed in MPEG-4 Audio Object Type Constants indicating the specific kind of data.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEG4HVXC

MPEG-4 HVXC. The flags field contains the MPEG-4 audio object type constant listed in MPEG-4 Audio Object Type Constants indicating the specific kind of data.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEG4TwinVQ

MPEG-4 TwinVQ. The flags field contains the MPEG-4 audio object type constant listed in MPEG-4 Audio Object Type Constants indicating the specific kind of data.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMACE3

MACE 3:1. Uses no flags.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatMACE6

MACE 6:1. Uses no flags.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatULaw

μLaw 2:1. Uses no flags.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatALaw

aLaw 2:1. Uses no flags.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatQDesign

QDesign music. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatQDesign2

QDesign2 music. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatQUALCOMM

QUALCOMM PureVoice. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEGLayer1

MPEG-1/2, Layer 1 audio. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEGLayer2

MPEG-1/2, Layer 2 audio. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatMPEGLayer3

MPEG-1/2, Layer 3 audio. Uses no flags

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatDVAudio

DV Audio. Uses no flags

Available in Mac OS X v10.3 through Mac OS X v10.4.

Declared in CoreAudioTypes.h

kAudioFormatVariableDurationDVAudio

Variable duration DV Audio. Uses no flags.

Available in Mac OS X v10.3 through Mac OS X v10.4.

Declared in CoreAudioTypes.h

kAudioFormatTimeCode

A stream of IOAudioTimeStamp structures. Uses the IOAudioTimeStamp flags (see Audio Time Stamp Flags and Audio Time Stamp Flag Combination Constant).

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatMIDIStream

A stream of MIDIPacketList structures where the time stamps in the MIDIPacket structures are sample offsets in the stream. The mSampleRate field in the AudioStreamBasicDescription structure is used to describe how time is passed in this kind of stream and an audio unit that receives or generates this stream can use this sample rate together with the number of frames it is rendering and the sample offsets within the MIDIPacketList to define the time for any MIDI event within this list. Uses no flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatParameterValueStream

A "side-chain" of Float32 data that can be fed or generated by an audio unit and that is used to send a high density of parameter value control information. An audio unit typically runs a parameter value stream at either the sample rate of the audio unit’s audio data, or some integer quotient of this (say a half or a third of the sample rate of the audio). The mSampleRate field in the AudioStreamBasicDescription structure describes this relationship. Uses no flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatAppleLossless

Apple Lossless. Uses no flags.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

AudioStreamBasicDescription Flags

Standard flags for use in the mFormatFlags field of the AudioStreamBasicDescription structure.

enum
{
   kAudioFormatFlagIsFloat                     = (1L << 0),
   kAudioFormatFlagIsBigEndian                 = (1L << 1),
   kAudioFormatFlagIsSignedInteger             = (1L << 2),
   kAudioFormatFlagIsPacked                    = (1L << 3),
   kAudioFormatFlagIsAlignedHigh               = (1L << 4),
   kAudioFormatFlagIsNonInterleaved            = (1L << 5),
   kAudioFormatFlagIsNonMixable                = (1L << 6),
   kAudioFormatFlagsAreAllClear                = (1L << 31),
   
   kLinearPCMFormatFlagIsFloat                 = kAudioFormatFlagIsFloat,
   kLinearPCMFormatFlagIsBigEndian             = kAudioFormatFlagIsBigEndian,
   kLinearPCMFormatFlagIsSignedInteger         = kAudioFormatFlagIsSignedInteger,
   kLinearPCMFormatFlagIsPacked                = kAudioFormatFlagIsPacked,
   kLinearPCMFormatFlagIsAlignedHigh           = kAudioFormatFlagIsAlignedHigh,
   kLinearPCMFormatFlagIsNonInterleaved        = kAudioFormatFlagIsNonInterleaved,
   kLinearPCMFormatFlagIsNonMixable            = kAudioFormatFlagIsNonMixable,
   kLinearPCMFormatFlagsAreAllClear            = kAudioFormatFlagsAreAllClear,
   
   kAppleLosslessFormatFlag_16BitSourceData    = 1,
   kAppleLosslessFormatFlag_20BitSourceData    = 2,
   kAppleLosslessFormatFlag_24BitSourceData    = 3,
   kAppleLosslessFormatFlag_32BitSourceData    = 4
};

Constants
kAudioFormatFlagIsFloat

Set for floating point, clear for integer.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsBigEndian

Set for big endian, clear for little endian.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsSignedInteger

Set for signed integer, clear for unsigned integer. This is only valid if kAudioFormatFlagIsFloat is clear.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsPacked

Set if the sample bits occupy the entire available bits for the channel, clear if they are high- or low-aligned within the channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsAlignedHigh

Set if the sample bits are placed into the high bits of the channel, clear for low bit placement. This is only valid if kAudioFormatFlagIsPacked is clear.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsNonInterleaved

Set if the samples for each channel are located contiguously and the channels are laid out end to end, clear if the samples for each frame are laid out contiguously and the frames laid out end to end. This flag affects the use of the AudioStreamBasicDescription and AudioBufferList structures; see the discussion of the AudioStreamBasicDescription structure for details.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagIsNonMixable

Set to indicate when a format is nonmixable. Note that this flag is only used when interacting with the HAL's stream format information. It is not a valid flag for any other use.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagsAreAllClear

Set to indicate all the flags are clear. You must use this constant instead of 0, because a 0 in the mFormatFlags field of the AudioStreamBasicDescription structure indicates that there are no format flags.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsFloat

Synonym for kAudioFormatFlagIsFloat.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsBigEndian

Synonym for kAudioFormatFlagIsBigEndian.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsSignedInteger

Synonym for kAudioFormatFlagIsSignedInteger.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsPacked

Synonym for kAudioFormatFlagIsPacked.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsAlignedHigh

Synonym for kAudioFormatFlagIsAlignedHigh.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsNonInterleaved

Synonym for kAudioFormatFlagIsNonInterleaved.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagIsNonMixable

Synonym for kAudioFormatFlagIsNonMixable.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kLinearPCMFormatFlagsAreAllClear

Synonym for kAudioFormatFlagsAreAllClear.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAppleLosslessFormatFlag_16BitSourceData

This flag is set for Apple Lossless data that was sourced from 16 bit native endian signed integer data.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAppleLosslessFormatFlag_20BitSourceData

Set for Apple Lossless data that was sourced from 20 bit native endian signed integer data aligned high in 24 bits.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAppleLosslessFormatFlag_24BitSourceData

Set for Apple Lossless data that was sourced from 24 bit native endian signed integer data.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAppleLosslessFormatFlag_32BitSourceData

Set for Apple Lossless data that was sourced from 32 bit native endian signed integer data.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

AudioStreamBasicDescription Flag Combinations Constants

Some commonly used combinations of flags for AudioStreamBasicDescription structures.

enum
{
#if TARGET_RT_BIG_ENDIAN
   kAudioFormatFlagsNativeEndian       = kAudioFormatFlagIsBigEndian,
#else
   kAudioFormatFlagsNativeEndian       = 0,
#endif
   kAudioFormatFlagsNativeFloatPacked  = kAudioFormatFlagIsFloat |
   kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked
};

Constants
kAudioFormatFlagsNativeEndian

Defined to set or clear kAudioFormatFlagIsBigEndian depending on the endianness of the processor at build time.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioFormatFlagsNativeFloatPacked

The flags for the canonical format of fully packed, native endian floating point data.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

MPEG-4 Audio Object Type Constants

Used in the mFormatFlags field of an AudioStreamBasicDescription structure that describes an MPEG-4 audio stream to specify the type of MPEG-4 audio data.

enum
{
   kMPEG4Object_AAC_Main       = 1,
   kMPEG4Object_AAC_LC         = 2,
   kMPEG4Object_AAC_SSR        = 3,
   kMPEG4Object_AAC_LTP        = 4,
   kMPEG4Object_AAC_SBR        = 5,
   kMPEG4Object_AAC_Scalable   = 6,
   
   kMPEG4Object_TwinVQ         = 7,
   kMPEG4Object_CELP           = 8,
   kMPEG4Object_HVXC           = 9
   
};

Constants
kMPEG4Object_AAC_Main

Advanced audio coding; the basic MPEG-4 technology.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_AAC_LC

Lossless coding; provides compression with no loss of quality.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_AAC_SSR

Scalable sampling rate; provides different sampling frequencies for different targets.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_AAC_LTP

Long term prediction; reduces redundancy in a coded signal.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_AAC_SBR

Spectral band replication; reconstructs high-frequency content from lower frequencies and side information.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_AAC_Scalable

Scalable lossless coding.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_TwinVQ

Transform-domain weighted interleaved vector quantization, an audio codec optimized for audio coding at ultra low bit rates around 8 kbit/s.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_CELP

Code Excited Linear Prediction, a narrow-band/wide-band speech codec.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kMPEG4Object_HVXC

Harmonic Vector Excitation Coding, a very-low bit-rate parametric speech codec.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

Discussion

See the Moving Picture Experts Group web page (http://www.chiariglione.org/mpeg/) for details about MPEG technologies.

Declared In
CoreAudioTypes.h

SMPTE Time Type Constants

Specify the type of SMPTE time.

enum
{
   kSMPTETimeType24        = 0,
   kSMPTETimeType25        = 1,
   kSMPTETimeType30Drop    = 2,
   kSMPTETimeType30        = 3,
   kSMPTETimeType2997      = 4,
   kSMPTETimeType2997Drop  = 5,
   kSMPTETimeType60        = 6,
   kSMPTETimeType5994      = 7
};

Constants
kSMPTETimeType24

24 video frames per second—standard for 16mm and 35mm film.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType25

25 video frames per second—standard for PAL and SECAM video.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType30Drop

30 video frames per second, with video-frame-number counts adjusted to ensure that the timecode matches elapsed clock time.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType30

30 video frames per second.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType2997

29.97 video frames per second—standard for NTSC video.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType2997Drop

29.97 video frames per second, with video-frame-number counts adjusted to ensure that the timecode matches elapsed clock time.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType60

60 video frames per second.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kSMPTETimeType5994

59.94 video frames per second..

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

SMPTE State Flags

Flags that describe the SMPTE time state.

enum
{
   kSMPTETimeValid     = (1L << 0),
   kSMPTETimeRunning   = (1L << 1)
};

Constants
kSMPTETimeValid

The full time is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kSMPTETimeRunning

Time is running.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

Audio Time Stamp Flags

Indicate which fields in an AudioTimeStamp structure are valid.

enum
{
   kAudioTimeStampSampleTimeValid      = (1L << 0),
   kAudioTimeStampHostTimeValid        = (1L << 1),
   kAudioTimeStampRateScalarValid      = (1L << 2),
   kAudioTimeStampWordClockTimeValid   = (1L << 3),
   kAudioTimeStampSMPTETimeValid       = (1L << 4)
};

Constants
kAudioTimeStampSampleTimeValid

The sample frame time is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kAudioTimeStampHostTimeValid

The host time is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kAudioTimeStampRateScalarValid

The rate scalar is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kAudioTimeStampWordClockTimeValid

The word clock time is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

kAudioTimeStampSMPTETimeValid

The SMPTE time is valid.

Available in Mac OS X v10.0 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

Audio Time Stamp Flag Combination Constant

A commonly used combination of audio time stamp flags.

enum {     kAudioTimeStampSampleHostTimeValid  = (kAudioTimeStampSampleTimeValid | kAudioTimeStampHostTimeValid) };

Constants
kAudioTimeStampSampleHostTimeValid

The sample frame time and the host time are valid.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

Declared In
CoreAudioTypes.h

Audio Channel Label Constants

Channel labels for use in the mChannelLabel field of an AudioChannelDescription structure.

enum
{
   kAudioChannelLabel_Unknown                  = 0xFFFFFFFF,
   kAudioChannelLabel_Unused                   = 0,
   kAudioChannelLabel_UseCoordinates           = 100,
   
   kAudioChannelLabel_Left                     = 1,
   kAudioChannelLabel_Right                    = 2,
   kAudioChannelLabel_Center                   = 3,
   kAudioChannelLabel_LFEScreen                = 4,
   kAudioChannelLabel_LeftSurround             = 5,
   kAudioChannelLabel_RightSurround            = 6,
   kAudioChannelLabel_LeftCenter               = 7,
   kAudioChannelLabel_RightCenter              = 8,
   kAudioChannelLabel_CenterSurround           = 9,
   kAudioChannelLabel_LeftSurroundDirect       = 10,
   kAudioChannelLabel_RightSurroundDirect      = 11,
   kAudioChannelLabel_TopCenterSurround        = 12,
   kAudioChannelLabel_VerticalHeightLeft       = 13,
   kAudioChannelLabel_VerticalHeightCenter     = 14,
   kAudioChannelLabel_VerticalHeightRight      = 15,
   
   kAudioChannelLabel_TopBackLeft              = 16,
   kAudioChannelLabel_TopBackCenter            = 17,
   kAudioChannelLabel_TopBackRight             = 18,
   
   kAudioChannelLabel_RearSurroundLeft         = 33,
   kAudioChannelLabel_RearSurroundRight        = 34,
   kAudioChannelLabel_LeftWide                 = 35,
   kAudioChannelLabel_RightWide                = 36,
   kAudioChannelLabel_LFE2                     = 37,
   kAudioChannelLabel_LeftTotal                = 38,
   kAudioChannelLabel_RightTotal               = 39,
   kAudioChannelLabel_HearingImpaired          = 40,
   kAudioChannelLabel_Narration                = 41,
   kAudioChannelLabel_Mono                     = 42,
   kAudioChannelLabel_DialogCentricMix         = 43,
   
   kAudioChannelLabel_CenterSurroundDirect     = 44,
   
   // first order ambisonic channels
   kAudioChannelLabel_Ambisonic_W              = 200,
   kAudioChannelLabel_Ambisonic_X              = 201,
   kAudioChannelLabel_Ambisonic_Y              = 202,
   kAudioChannelLabel_Ambisonic_Z              = 203,
   
   // Mid/Side Recording
   kAudioChannelLabel_MS_Mid                   = 204,
   kAudioChannelLabel_MS_Side                  = 205,
   
   // X-Y Recording
   kAudioChannelLabel_XY_X                     = 206,
   kAudioChannelLabel_XY_Y                     = 207,
   
   // other
   kAudioChannelLabel_HeadphonesLeft           = 301,
   kAudioChannelLabel_HeadphonesRight          = 302,
   kAudioChannelLabel_ClickTrack               = 304,
   kAudioChannelLabel_ForeignLanguage          = 305,
   
   // generic discrete channel
   kAudioChannelLabel_Discrete                 = 400,
   
   // numbered discrete channel
   kAudioChannelLabel_Discrete_0               = (1L<<16) | 0,
   kAudioChannelLabel_Discrete_1               = (1L<<16) | 1,
   kAudioChannelLabel_Discrete_2               = (1L<<16) | 2,
   kAudioChannelLabel_Discrete_3               = (1L<<16) | 3,
   kAudioChannelLabel_Discrete_4               = (1L<<16) | 4,
   kAudioChannelLabel_Discrete_5               = (1L<<16) | 5,
   kAudioChannelLabel_Discrete_6               = (1L<<16) | 6,
   kAudioChannelLabel_Discrete_7               = (1L<<16) | 7,
   kAudioChannelLabel_Discrete_8               = (1L<<16) | 8,
   kAudioChannelLabel_Discrete_9               = (1L<<16) | 9,
   kAudioChannelLabel_Discrete_10              = (1L<<16) | 10,
   kAudioChannelLabel_Discrete_11              = (1L<<16) | 11,
   kAudioChannelLabel_Discrete_12              = (1L<<16) | 12,
   kAudioChannelLabel_Discrete_13              = (1L<<16) | 13,
   kAudioChannelLabel_Discrete_14              = (1L<<16) | 14,
   kAudioChannelLabel_Discrete_15              = (1L<<16) | 15,
   kAudioChannelLabel_Discrete_65535           = (1L<<16) | 65535
};

Constants
kAudioChannelLabel_Unknown

Unknown role or unspecified other use for channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Unused

The channel is present, but has no intended role or destination.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_UseCoordinates

The channel is described solely by the mCoordinates field of the AudioChannelDescription structure.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Left

Left channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Right

Right channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Center

Center channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LFEScreen

Low Frequency Effects Screen; a subwoofer located in front of the theater.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LeftSurround

Left surround channel; or for WAVE (.wav) files, back left.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RightSurround

Right surround channel; or for WAVE (.wav) files, back right.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LeftCenter

Left center channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RightCenter

Right center channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_CenterSurround

Center surround channel; or for WAVE (.wav) files, back center or rear surround.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LeftSurroundDirect

Left surround direct channel; or for WAVE (.wav) files, side left.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RightSurroundDirect

Right surround direct channel; or for WAVE (.wav) files, side right.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_TopCenterSurround

Top center surround-sound channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_VerticalHeightLeft

Vertical height left channel; or for WAVE (.wav) files, top front left.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_VerticalHeightCenter

Vertical height center channel; or for WAVE (.wav) files, top front center.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_VerticalHeightRight

Vertical height right channel; or for WAVE (.wav) files, top front right.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_TopBackLeft

Top back left channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_TopBackCenter

Top back center channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_TopBackRight

Top back right channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RearSurroundLeft

Rear surround left channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RearSurroundRight

Rear surround right channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LeftWide

Left wide channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RightWide

Right wide channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LFE2

Low Frequency Effects 2.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_LeftTotal

The left channel of matrix encoded 4 channel audio.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_RightTotal

The right channel of matrix encoded 4 channel audio.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_HearingImpaired

Channel carrying audio for the hearing impaired.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Narration

Narration channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Mono

Monaural channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_DialogCentricMix

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_CenterSurroundDirect

Back center, non diffuse channel.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Ambisonic_W

First order Ambisonic channel W.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Ambisonic_X

First order Ambisonic channel X.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Ambisonic_Y

First order Ambisonic channel Y.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Ambisonic_Z

First order Ambisonic channel Z.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_MS_Mid

Mid channel of a Mid/Side recording.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_MS_Side

Side channel of a Mid/Side recording.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_XY_X

X channel of an X-Y recording.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_XY_Y

Y channel of an X-Y recording.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_HeadphonesLeft

Left channel of stereo headphones.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_HeadphonesRight

Right channel of stereo headphones.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_ClickTrack

Click track channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_ForeignLanguage

Foreign language channel.

Available in Mac OS X v10.2 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Discrete

Generic discrete channel.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Discrete_0

Discrete channel 0.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Discrete_1

Discrete channel 1.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Discrete_2

Discrete channel 2.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h

kAudioChannelLabel_Discrete_3

Discrete channel 3.

Available in Mac OS X v10.3 and later.

Declared in CoreAudioTypes.h