Function

AudioQueueAllocateBuffer

Asks an audio queue object to allocate an audio queue buffer.

Declaration

OSStatus AudioQueueAllocateBuffer(AudioQueueRef inAQ, UInt32 inBufferByteSize, AudioQueueBufferRef  _Nullable *outBuffer);

Parameters

inAQ

The audio queue you want to allocate a buffer.

inBufferByteSize

The desired capacity of the new buffer, in bytes. Appropriate capacity depends on the processing you will perform on the data as well as on the audio data format.

outBuffer

On output, points to the newly allocated audio queue buffer.

Return Value

A result code. See Result Codes.

Discussion

Once allocated, the pointer to the audio queue buffer and the buffer’s capacity cannot be changed. The buffer’s size field, mAudioDataByteSize, which indicates the amount of valid data, is initially set to 0.

See Also

Handling Audio Queue Buffers

AudioQueueAllocateBufferWithPacketDescriptions

Asks an audio queue object to allocate an audio queue buffer with space for packet descriptions.

AudioQueueFreeBuffer

Asks an audio queue to dispose of an audio queue buffer.

AudioQueueEnqueueBuffer

Adds a buffer to the buffer queue of a recording or playback audio queue.

AudioQueueEnqueueBufferWithParameters

Adds a buffer to the buffer queue of a playback audio queue object, specifying start time and other settings.