audio-controls

Control microphone mute and audio output routing for CometChat iOS calls.

31|9|Updated Mar 10, 2023
One-click install
npx skills add https://github.com/cometchat/calls-sdk-ios --skill audio-controls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-controls
Source: https://github.com/cometchat/calls-sdk-ios/tree/main/skills/audio-controls
Command: npx skills add https://github.com/cometchat/calls-sdk-ios --skill audio-controls

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about audio-controls

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mute and unmute the microphone during a CometChat iOS call?

Switch audio output routing during a call by configuring AVAudioSession, using overrideOutputAudioPort for speaker or earpiece selection and setCategory to enable Bluetooth playback when available.

How do I keep my call UI in sync with audio state changes?

Keep your call UI in sync with audio state changes by implementing media event listeners that monitor the active call session and update mute button toggles and audio mode indicators dynamically.

Can I start a CometChat call session with the audio already muted?

Yes, you can initialize the call session with the microphone muted and optionally hide built-in audio controls during initial audio configuration to enforce specific call behaviors upon connection.

Does this approach support Bluetooth audio routing for voice and video sessions?

Yes, Bluetooth audio routing is supported by applying AVAudioSession setCategory configurations alongside CallSession audio APIs to detect Bluetooth availability and route playback for voice and video sessions.