Skip to content

Commit 37f9711

Browse files
committed
Initial unmute for restart mute mode
1 parent 24117ac commit 37f9711

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

modules/audio_device/audio_engine_device.mm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,12 +1665,14 @@
16651665
LOGI() << "setVoiceProcessingEnabled (input) result: " << set_vp_result ? "YES" : "NO";
16661666
}
16671667

1668-
if (!this->InputNode().isVoiceProcessingAGCEnabled) {
1669-
LOGW() << "voiceProcessingAGCEnabled (input) is false, ensure AVAudioSession.Mode is "
1670-
"videoChat or voiceChat.";
1671-
}
1672-
16731668
if (this->InputNode().voiceProcessingEnabled) {
1669+
// Always unmute vp if restart mute mode.
1670+
if (state.next.mute_mode == MuteMode::RestartEngine &&
1671+
this->InputNode().voiceProcessingInputMuted) {
1672+
LOGI() << "setVoiceProcessingInputMuted: un-muting vp for restart mute mode";
1673+
this->InputNode().voiceProcessingInputMuted = false;
1674+
}
1675+
16741676
// Muted talker detection.
16751677
if (@available(iOS 17.0, macCatalyst 17.0, macOS 14.0, tvOS 17.0, visionOS 1.0, *)) {
16761678
auto listener_block = ^(AVAudioVoiceProcessingSpeechActivityEvent event) {
@@ -1809,10 +1811,11 @@
18091811
state.next.IsInputEnabled());
18101812
}
18111813

1814+
// Run-time mute toggling if vp mode.
18121815
if (state.next.mute_mode == MuteMode::VoiceProcessing && state.next.IsInputEnabled() &&
18131816
this->InputNode().voiceProcessingEnabled &&
18141817
this->InputNode().voiceProcessingInputMuted != state.next.input_muted) {
1815-
LOGI() << "setVoiceProcessingInputMuted: " << state.next.input_muted;
1818+
LOGI() << "setVoiceProcessingInputMuted (runtime): " << state.next.input_muted;
18161819
this->InputNode().voiceProcessingInputMuted = state.next.input_muted;
18171820
}
18181821

0 commit comments

Comments
 (0)