VAD behaviour
Voice Activity Detection (VAD) runs server-side. Your app streams a continuous audio capture to the Humain server — you do not implement push-to-talk or silence detection. The server:- Receives the raw audio stream
- Detects when the user starts speaking
- Detects end-of-utterance after 600 ms of silence
- Streams the accumulated audio to Gemini Live — a single audio-in/audio-out model that handles speech understanding, inference, and voice synthesis natively, with no separate STT or TTS step
- Streams the AI’s audio response back to the device
VoiceStatus / VoiceStatus enum and the delegate/listener callbacks.
The VAD sensitivity (silence threshold) is configured per kiosk in the admin panel under
Kiosk → Voice settings → VAD sensitivity. There is no per-session API to override it.
Barge-in
Barge-in allows the user to interrupt the AI while it is speaking. When the server detects user speech during AI audio playback:- The AI’s audio output is cancelled immediately
- The captured speech is processed as a new turn
- The
VoiceStatustransitions:speaking→listening→processing
- Cancelling the current audio playback
- Resuming microphone capture
- Notifying the delegate/listener of the status change
didTranscribe / onTranscript callback fires with the barge-in text, allowing you to
update the UI to show what the user said.
Network interruptions
Brief network drops (under 5 seconds) are handled transparently:- The SDK detects the WebRTC connection drop via
ICE connection state change - ICE restarts automatically using the existing session credentials
- If reconnection succeeds within 5 seconds, the session resumes — no server state is lost; conversation history is preserved
- The delegate/listener receives
status: .connecting/VoiceStatus.CONNECTINGduring reconnection - If reconnection fails after 5 seconds,
didFailWith error:/onError()is called with anetworkError
- Show a reconnecting indicator when status is
.connecting - Offer a “Retry” button when
didFailWith/onErrorfires with a network error - Call
startSession()again to open a new session after a hard failure
Background behaviour
- iOS
- Android
By default, iOS suspends all app threads when the app moves to the background — the voice
session stops capturing and streaming audio.To keep a voice session alive in the background:
- Add the Audio, AirPlay, and Picture in Picture background mode capability in Xcode
- Activate
AVAudioSessionbefore the session starts (see iOS audio session)
AVAudioSession remains active and the voice
session continues while the app is backgrounded. This is appropriate for AI assistant apps
where a conversation must not be interrupted by the user switching apps briefly.Without the capability, the session pauses on backgrounding and resumes on foreground —
the server preserves session state for up to 30 minutes.Battery and performance
The SDK uses the device’s hardware audio codec via
AVAudioEngine (iOS) or AudioRecord
(Android). The WebRTC stack encodes to Opus at 16 kbps during silence and up to 40 kbps
during speech.
To minimise battery consumption for long-running deployments (kiosk terminals):
- Keep the device plugged in
- Disable screen auto-lock when a session is active (
UIApplication.shared.isIdleTimerDisabled = trueon iOS;WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ONon Android) - Use a wired headset or built-in speaker rather than Bluetooth (Bluetooth SCO draws ~30% more power than wired audio)