--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/eda37b02-055f-4b12-a46d-f371f0e52d3a%40googlegroups.com.
AudioProcessing::Config APconfig;
APconfig.noise_suppression.enabled = true;
APconfig.echo_canceller.enabled = true;
APconfig.high_pass_filter.enabled = true;
audioProcessing->ApplyConfig(APconfig);iOS only supports built-in AEC in the modes you mentioned where echo is cancelled. To support echo cancellation for other modes, you must modify the WebRTC stack to enable its own software-based AEC instead. Might require some changes and no guarantees that it works well.
On Sat, Feb 22, 2020 at 12:44 AM Tan Pham Anh <tanph...@gmail.com> wrote:
Hi,How can I avoid audio echo when make a Webrtc Call using AVAudioSessionCategoryPlayAndRecord and AVAudioSessionModeDefault.If I switch AVAudioSessionCategoryPlayAndRecord and AVAudioSessionModeVideoChat, echo cancellation working normally but my AVAudioPlayer has a small volume. So I changed audio mode to AVAudioSessionModeDefault and echo cancellation is gone :(--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/b8faaec4-e5f0-41ca-9d1d-6de559cc3393%40googlegroups.com.
I/org.webrtc.Logging: WebRtcAudioEffects: canUseAcousticEchoCanceler: falseI/org.webrtc.Logging: WebRtcAudioEffects: canUseNoiseSuppressor: falseW/org.webrtc.Logging: WebRtcAudioManager: AAudio support is currently disabled on all devices!I/audio_manager.cc: (line 276): OnCacheAudioParameters: hardware_aec: 0, hardware_agc: 0, hardware_ns: 0, low_latency_output: 0, low_latency_input: 0, pro_audio: 0, a_audio: 0, sample_rate: 48000, output_channels: 1, input_channels: 1, output_buffer_size: 1924, input_buffer_size: 1920 webrtc::Config config;
config.Set<webrtc::ExperimentalAgc>(new webrtc::ExperimentalAgc(false));
rtc::scoped_refptr<webrtc::AudioProcessing> audioProcessing = AudioProcessingBuilder().Create(config);
webrtc::AudioDeviceModule::AudioLayer audioLayer = webrtc::AudioDeviceModule::kPlatformDefaultAudio;
auto audioDeviceModule = _audioDeviceDataObserver ?
webrtc::CreateAudioDeviceWithDataObserver(
audioLayer, getWebRTCTaskQueueFactory(), _audioDeviceDataObserver.get()) :
webrtc::AudioDeviceModule::Create(audioLayer, getWebRTCTaskQueueFactory());
constexpr uint16_t kDefaultDeviceId = 0;
bool available = false;
if (audioDeviceModule->Init() != 0) {
LOG_E("Failed to initialize the AudioDeviceModule.");
throw MediaException("Failed to initialize the AudioDeviceModule.");
}
if (audioDeviceModule->SetPlayoutDevice(kDefaultDeviceId) != 0) {
LOG_E("Failed to activate audio playout device.");
throw MediaException("Failed to activate audio playout device.");
}
if (audioDeviceModule->InitSpeaker() != 0)
LOG_W("Failed to initialize speaker.");
if (audioDeviceModule->StereoPlayoutIsAvailable(&available) != 0)
LOG_W("Failed to query stereo playout.");
if (audioDeviceModule->SetStereoPlayout(available) != 0)
LOG_W("Failed to enable stereo playout.");
if (audioDeviceModule->SetRecordingDevice(kDefaultDeviceId) != 0) {
LOG_E("Failed to activate audio recording device.");
throw MediaException("Failed to activate audio recording device.");
}
if (audioDeviceModule->InitMicrophone() != 0)
LOG_W("Failed to initialize microphone.");
if (audioDeviceModule->StereoRecordingIsAvailable(&available) != 0)
LOG_W("Failed to query stereo recording.");
if (audioDeviceModule->SetStereoRecording(available) != 0)
LOG_W("Failed to enable stereo recording.");
if (audioDeviceModule->BuiltInAECIsAvailable() && audioDeviceModule->EnableBuiltInAEC(true) != 0) {
LOG_I("succesfully enabled built-in AEC");
} else {
LOG_E("failed to enable built-in AEC");
}
if (audioDeviceModule->BuiltInAGCIsAvailable() && audioDeviceModule->EnableBuiltInAGC(true) != 0) {
LOG_I("succesfully enabled built-in AGC");
} else {
LOG_E("failed to enable built-in AGC");
}
if (audioDeviceModule->BuiltInNSIsAvailable() && audioDeviceModule->EnableBuiltInNS(true) != 0) {
LOG_I("succesfully enabled built-in NS");
} else {
LOG_E("failed to enable built-in NS");
}
AudioState::Config audioStateConfig;
audioStateConfig.audio_mixer = AudioMixerImpl::Create();
audioStateConfig.audio_processing = audioProcessing;
audioStateConfig.audio_device_module = audioDeviceModule;
auto audioState = AudioState::Create(audioStateConfig);AudioProcessing::Config APconfig;
APconfig.echo_canceller.enabled = true;
audioProcessing->ApplyConfig(APconfig);To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/b8faaec4-e5f0-41ca-9d1d-6de559cc3393%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/5b0078e5-70d2-461a-a278-46e955c29b01%40googlegroups.com.