Contents

voiceChat

A mode that indicates that your app is performing two-way voice communication, such as using Voice over Internet Protocol (VoIP).

Declaration

static let voiceChat: AVAudioSession.Mode

Discussion

This mode is appropriate for Voice over IP (VoIP) apps that use the playAndRecord category. When you set this mode, the session optimizes the device’s tonal equalization for voice and reduces the set of allowed audio routes to only those suitable for voice chat. Setting this mode also causes the system to automatically apply the allowBluetoothHFP category option.

VoIP apps should also use the Audio Unit Voice I/O as it provides useful voice features, including automatic gain correction, adjustment of voice processing, and muting. When an app uses this Audio Unit without explicitly setting its mode to a chat variant (voice, video, or game), the session sets the voiceChat mode implicitly. However, if an app previously set its category to playAndRecord and mode to videoChat or gameChat, instantiating the Audio Unit doesn’t cause the mode to change.

For apps that use one or more chat modes (voice, video, or game), but don’t use Audio Unit Voice I/O or AVAudioEngine with setVoiceProcessingEnabled(_:), the system reduces the processing it applies to audio signals. Specifically, it doesn’t apply voice-specific processing, like echo cancellation and automatic gain correction, and disables dynamic processing on input and output, which results in a lower playback level.

See Also

Getting Standard Session Modes