feat(audio): add AudioManager microphone mute mode API#1124
Draft
hiroshihorie wants to merge 1 commit into
Draft
feat(audio): add AudioManager microphone mute mode API#1124hiroshihorie wants to merge 1 commit into
hiroshihorie wants to merge 1 commit into
Conversation
Adds AudioManager.setMicrophoneMuteMode/getMicrophoneMuteMode with a LiveKit-owned MicrophoneMuteMode enum (voiceProcessing, restart, inputMixer), mirroring the Swift SDK. Controls how the AVAudioEngine audio device module mutes mic input on iOS/macOS; no-op elsewhere, including for unknown, so get/set round-trips are safe cross-platform. voiceProcessing (the default) plays the platform mute tone, inputMixer and restart mute silently. The mode applies to LiveKit's own mute path: disabling a published local audio track drives the engine-level microphone mute. Requires flutter_webrtc with microphone mute mode support (see local pubspec_overrides.yaml until released).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
AudioManager.setMicrophoneMuteMode/getMicrophoneMuteModewith a LiveKit-ownedMicrophoneMuteModeenum (voiceProcessing,restart,inputMixer), mirroring the Swift SDK'sAudioManager.microphoneMuteMode.Background
On iOS/macOS the AVAudioEngine-based ADM defaults to
voiceProcessingmuting, which plays the platform's mute/unmute sound effect. This is the LiveKit-level counterpart of flutter-webrtc/flutter-webrtc#2105 (see also flutter-webrtc/flutter-webrtc#2098): apps can selectinputMixerorrestartto mute silently.The mode applies to LiveKit's own mute path: disabling a published local audio track drives the engine-level microphone mute in webrtc (
WebRtcVoiceSendChannel::MuteStream→adm->SetMicrophoneMute). For the fastest silent mute toggling, combineinputMixerwithAudioCaptureOptions(stopAudioCaptureOnMute: false)— documented on the API.API notes
restart, notrestartEngine); the mapping to flutter_webrtc happens internally.unknown, soset(await get())round-trips safely in cross-platform code.Dependencies
flutter_webrtcpin is bumped here (local development uses a gitignoredpubspec_overrides.yaml).Testing
dart analyze lib testclean, all 314 tests pass.