设备之间正在建立对等连接,并且任何一方的人都能够进行通信。任何一个或两个设备都使用EARPIECE时不会出现任何问题。
当两个设备都使用EARPHONES或INBUILT_SPEAKER进行音频通信时,就会出现问题。
依赖:'org.webrtc:google-webrtc:1.0.30039'
我已经尝试过以下选项
选项1
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"));
选项-2
JavaAudioDeviceModule.builder ( mContext )
.setUseHardwareAcousticEchoCanceler(false)
.setUseHardwareNoiseSuppressor(false)
.createAudioDeviceModule ();
WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor ( true );
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler ( true );
WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl ( true );
请帮我弄清楚缺少什么。我怎样才能消除或减少这种回声?