The call to setVoiceProcessingEnabled(isEnabled: Bool) is synchronous, it triggers a configuration change in the engine, so you must ensure that you access formats from input and output node after changing the voice processing enabled state to ensure you’re configuring your graph with the correct formats.
Additionally there is some sample code available here as part of the AVEchoTouch project - https://developer.apple.com/documentation/avfaudio/using-voice-processing?language=objc
Topic:
Media Technologies
SubTopic:
Audio
Tags: