What problem does it solve?
It solves the challenge of controlling microphone state and choosing the correct audio output (speaker, earpiece, or Bluetooth) during a live CometChat voice/video call.
Core Features & Use Cases
- Microphone mute/unmute: Programmatically mute and unmute the local microphone during an active session.
- Audio output switching: Change the device routing using AVAudioSession (speaker/earpiece) and configure Bluetooth playback when available.
- Audio event handling: Listen for audio state changes to keep your UI (mute button and audio mode indicators) in sync.
- Initial audio configuration: Start a session with audio muted and optionally show/hide built-in audio controls.
Quick Start
Configure your call UI to mute/unmute via CallSession.shared.muteAudio() and CallSession.shared.unmuteAudio(), and switch output with AVAudioSession.overrideOutputAudioPort for speaker/earpiece or setCategory for Bluetooth.