Function

AudioQueuePrime

Decodes enqueued buffers in preparation for playback.

Declaration

OSStatus AudioQueuePrime(AudioQueueRef inAQ, UInt32 inNumberOfFramesToPrepare, UInt32 *outNumberOfFramesPrepared);

Parameters

inAQ

The audio queue to be primed.

inNumberOfFramesToPrepare

The number of frames to decode before returning. Pass 0 to decode all enqueued buffers.

outNumberOfFramesPrepared

On output, the number of frames actually decoded and prepared for playback. Pass NULL on input if you you are not interested in this information.

Return Value

A result code. See Result Codes.

Discussion

This function decodes enqueued buffers in preparation for playback. It returns when at least the number of audio sample frames specified in inNumberOfFramesToPrepare are decoded and ready to play, or (if you pass 0 for the inNumberOfFramesToPrepare parameter), when all enqueued buffers are decoded.

To make a buffer of audio data ready to play, use AudioQueuePrime as follows:

  1. Call AudioQueueEnqueueBuffer.

  2. Call AudioQueuePrime.

  3. Call AudioQueueStart.

See Also

Controlling Audio Queues

AudioQueueStart

Begins playing or recording audio.

AudioQueueFlush

Resets an audio queue’s decoder state.

AudioQueueStop

Stops playing or recording audio.

AudioQueuePause

Pauses audio playback or recording.

AudioQueueReset

Resets an audio queue.