Function

AudioUnitReset

Resets an audio unit’s render state.

Declaration

OSStatus AudioUnitReset(AudioUnit inUnit, AudioUnitScope inScope, AudioUnitElement inElement);

Parameters

inUnit

The audio unit whose render state you are resetting.

inScope

The audio unit scope, typically set to kAudioUnitScope_Global.

inElement

The audio unit element, typically set to 0.

Return Value

A result code.

Discussion

This function resets the render state of an audio unit. For example, with a delay or reverb type of audio unit, it clears all of the delay lines maintained within the audio unit. Typically, you call this function when an audio unit was previously rendering and was taken out of the render chain (for example, if the track it is in gets muted) and is now being added back in (for example, unmuted). Your application should reset the audio unit before adding it back to the render chain so that it does not produce audio from its delay lines that is no longer valid.

This function clears memory. It does not allocate or free memory resources.

See Also

Audio Unit Initialization and Rendering Audio

AudioUnitInitialize

Initializes an audio unit

AudioUnitUninitialize

Uninitializes an audio unit.

AudioUnitAddRenderNotify

Registers a callback to receive audio unit render notifications.

AudioUnitRemoveRenderNotify

Unregisters a previously-registered render listener callback function.

AudioUnitRender

Initiates a rendering cycle for an audio unit.