首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WebRTC安卓回声消除

WebRTC安卓回声消除
EN

Stack Overflow用户
提问于 2020-06-20 07:16:45
回答 1查看 2K关注 0票数 3

我想在android中实现语音和视频通话。我引用了这个示例项目作为参考:Amazon Kinesis Video Streams Android WebRTC SDK问题是麦克风拾取远程声音,这导致了极端的回声效果。我们使用这个版本:

代码语言:javascript
复制
org.webrtc:google-webrtc:1.0.30039

AudioManager处于此模式:

代码语言:javascript
复制
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
audioManager.setSpeakerphoneOn(false);

这是我们尝试过的,但没有任何效果:

代码语言:javascript
复制
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
WebRtcAudioUtils.useWebRtcBasedAcousticEchoCanceler();
WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
WebRtcAudioUtils.useWebRtcBasedAutomaticGainControl();
WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);
WebRtcAudioUtils.useWebRtcBasedNoiseSuppressor();
WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);

还有这个:

代码语言:javascript
复制
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googEchoCancellation", "true"));
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googEchoCancellation2", "true"));
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googDAEchoCancellation", "true"));

audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googTypingNoiseDetection", "true"));

audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAutoGainControl", "true"));
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAutoGainControl2", "true"));

audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googNoiseSuppression", "true"));
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googNoiseSuppression2", "true"));

audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAudioMirroring", "false"));
audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googHighpassFilter", "true"));

我真的迷路了。如何在android中开通回声消除?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-23 00:14:58

使用JavaAudioDeviceModule.class的以下方法

代码语言:javascript
复制
setUseHardwareAcousticEchoCanceler(false)       
setUseHardwareNoiseSuppressor(false) 

(作为参考,请查看PeerConnectionClient.java - Checkout official android example on googlesource.com的createJavaAudioDevice()也可以查看Somesh的GitHub项目(https://github.com/TheSomeshKumar/AndroidWebRTCGradle)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62479789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档