Skip to main content
This page is a reference for AVAudioSession configuration in iOS apps using the Humain Kiosk voice SDK. Read this if you need to customise audio routing beyond what the iOS guide covers, or if you are integrating the session into an app that already manages AVAudioSession (e.g., a music player or call app).

Category selection

The AVAudioSession category determines what your app can do with audio. For voice sessions, use .playAndRecord:

Mode selection

The mode fine-tunes processing within the category. For voice sessions:
.voiceChat activates hardware echo cancellation (AEC) and automatic gain control (AGC). These are essential for voice sessions — without AEC the microphone picks up the AI’s TTS audio and feeds it back to the server.

Option flags


Activation and deactivation

Always call setActive(false, options: .notifyOthersOnDeactivation) when you stop your voice session. Failing to deactivate prevents other apps (e.g., Spotify, podcasts) from resuming their audio.

Interruption notifications

Register for AVAudioSession.interruptionNotification to handle incoming calls, Siri activation, and alarm sounds:

Route change notifications

Register for AVAudioSession.routeChangeNotification to handle headphone plug/unplug and Bluetooth connect/disconnect events:

Current route inspection

Query the current audio output route to show the user where audio is playing: