From 57b35696f89f8ed7f7c32441e7f01a8524cbc0a2 Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Tue, 7 Jun 2022 09:13:15 +0800 Subject: [PATCH] fix: Fix can't open mic alone when built-in AEC is enabled. (#29) --- audio/audio_state.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/audio/audio_state.cc b/audio/audio_state.cc index 9e5b63b999..c564f228d0 100644 --- a/audio/audio_state.cc +++ b/audio/audio_state.cc @@ -104,6 +104,14 @@ void AudioState::AddSendingStream(webrtc::AudioSendStream* stream, if (!adm->Recording()) { if (adm->InitRecording() == 0) { if (recording_enabled_) { +#if defined(WEBRTC_WIN) + if (adm->BuiltInAECIsAvailable() && !adm->Playing()) { + if (!adm->PlayoutIsInitialized()) { + adm->InitPlayout(); + } + adm->StartPlayout(); + } +#endif adm->StartRecording(); } } else {