Function

AudioQueueAddPropertyListener

Adds a property listener callback to an audio queue.

Declaration

OSStatus AudioQueueAddPropertyListener(AudioQueueRef inAQ, AudioQueuePropertyID inID, AudioQueuePropertyListenerProc inProc, void *inUserData);

Parameters

inAQ

The audio queue that you want to assign a property listener callback to.

inID

The ID of the property whose changes you want to respond to. See AudioQueuePropertyID.

inProc

The callback to be invoked when the property value changes.

inUserData

Custom data for the property listener callback.

Return Value

A result code. See Result Codes.

Discussion

Use this function to let your application respond to property value changes in an audio queue. For example, say your application’s user interface has a button that acts as a Play/Stop toggle switch. When an audio file has finished playing, the audio queue stops and the value of the kAudioQueueProperty_IsRunning property changes from true to false. You can use a property listener callback to update the button text appropriately.

See Also

Manipulating Audio Queue Properties

AudioQueueGetProperty

Gets an audio queue property value.

AudioQueueSetProperty

Sets an audio queue property value.

AudioQueueGetPropertySize

Gets the size of the value of an audio queue property.

AudioQueueRemovePropertyListener

Removes a property listener callback from an audio queue.