Contents

kAudioUnitProperty_ShouldAllocateBuffer

A read/write UInt32 value valid on the audio unit input and output scopes, settable individually on each element.

Declaration

var kAudioUnitProperty_ShouldAllocateBuffer: AudioUnitPropertyID { get }

Discussion

Default value is true, which means that the associated audio unit element creates a buffer for rendering into.

If true, the element will create a buffer for rendering into.

If false, the element will not create a buffer for rendering.

For example, if the audio unit is only ever going to have a connection as its input and never a callback, then it should not need to create a buffer (the API contract expects an audio unit to provide a buffer for callbacks, but no buffer for connections).

If the audio unit is always going to be pulled for audio with the client providing audio data buffers to the AudioUnitRender call, then it will never need to create an audio buffer on the output side.

So, this property can be used to control the default allocation strategy of an audio unit. If the audio unit needs a buffer, but one hasn’t been allocated, then an error will be thrown from that call to AudioUnitRender.

This property cannot be set on initialized audio units as it may end up reallocating memory.

See Also

Properties