Function

AudioUnitReset(_:_:_:)

Resets an audio unit’s render state.

Declaration

func AudioUnitReset(_ inUnit: AudioUnit, _ inScope: AudioUnitScope, _ inElement: AudioUnitElement) -> OSStatus

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software