Type Alias

AudioQueuePropertyID

Identifiers for audio queue properties.

Declaration

typealias AudioQueuePropertyID = UInt32

Discussion

To receive a notification that a specific audio queue property has changed:

  1. Define a property listener callback, referencing the desired audio queue property ID. Base the callback on the AudioQueuePropertyListenerProc callback function declaration.

  2. Assign the callback to an audio queue using the AudioQueueAddPropertyListener(_:_:_:_:) function.

  3. When you get a property-changed notification, call the AudioQueueGetProperty(_:_:_:_:) function to get the current value of the property.

Topics

Constants

var kAudioQueueProperty_IsRunning: AudioQueuePropertyID

Value is a read-only UInt32 value indicating whether or not the audio queue is running. A nonzero value means running; 0 means stopped. A notification is sent when the associated audio queue starts or stops, which may occur sometime after the AudioQueueStart(_:_:) or AudioQueueStop(_:_:) function is called.

var kAudioQueueDeviceProperty_SampleRate: AudioQueuePropertyID

Value is a read-only Float64 value representing the sampling rate of the audio hardware device associated with an audio queue.

var kAudioQueueDeviceProperty_NumberChannels: AudioQueuePropertyID

Value is a read-only UInt32 value representing the number of channels in the audio hardware device associated with an audio queue.

var kAudioQueueProperty_CurrentDevice: AudioQueuePropertyID

Value is a read-write CFString object representing the unique identifier (UID) of the audio hardware device associated with an audio queue.

var kAudioQueueProperty_MagicCookie: AudioQueuePropertyID

Value is a read/write void pointer to a block of memory, which you set up, containing an audio format magic cookie. If the audio format you are playing or recording to requires a magic cookie, you must set a value for this property before enqueuing any buffers.

var kAudioQueueProperty_MaximumOutputPacketSize: AudioQueuePropertyID

Value is a read-onlyUInt32 value that is the size, in bytes, of the largest single packet of data in the output format. Primarily useful when encoding VBR compressed data.

var kAudioQueueProperty_StreamDescription: AudioQueuePropertyID

Value is a read-only AudioStreamBasicDescription structure, indicating an audio queue’s data format. Primarily useful for obtaining a complete ASBD when recording, in cases where you initially specify a sample rate of 0.

var kAudioQueueProperty_ChannelLayout: AudioQueuePropertyID

Value is a read/write AudioChannelLayout structure that describes an audio queue channel layout. The number of channels in the layout must match the number of channels in the audio format. This property is typically not used in the case of one or two channel audio. For more than two channels (such as in the case of 5.1 surround sound), you may need to specify a channel layout to indicate channel order, such as left, then center, then right.

var kAudioQueueProperty_EnableLevelMetering: AudioQueuePropertyID

Value is a read/write UInt32 value that indicates whether audio level metering is enabled for an audio queue. 0 = metering off, 1 = metering on.

var kAudioQueueProperty_CurrentLevelMeter: AudioQueuePropertyID

Value is a read-only array of AudioQueueLevelMeterState structures, one array element per audio channel. The member values in the structure are in the range 0 (for silence) to 1 (indicating maximum level).

var kAudioQueueProperty_CurrentLevelMeterDB: AudioQueuePropertyID

Value is a read-only array of AudioQueueLevelMeterState structures, one array element per audio channel. The member values in the structure are in decibels.

var kAudioQueueProperty_DecodeBufferSizeFrames: AudioQueuePropertyID

Value is a read/write UInt32 value that is the size of the buffer into which a playback (output) audio queue decodes buffers. A larger buffer provides more reliability and better long-term performance at the expense of memory and decreased responsiveness in some situations.

var kAudioQueueProperty_ConverterError: AudioQueuePropertyID

Value is a read-only UInt32 value that indicates the most recent error (if any) encountered by the audio queue’s internal encoding/decoding process.