How to use echo cancellation in WebRTC properly

2,513 views
Skip to first unread message

wenjing fan

unread,
Aug 18, 2014, 9:32:24 PM8/18/14
to discuss...@googlegroups.com
Dear developers, 

I am developing a VoIP software using WebRTC as audio processing library. I only used the audio_processing in modules before. It is working well except I have to calculate the delay between far-end audio stream and the near-end stream. Currently I am using other way to get the delay, then I pass it to echo canceller by webrtc::AudioProcessing::set_stream_delay_ms(int delay), and then I use AnalyzeReverseStream(&far_frame) and ProcessStream(&near_frame) to do the echo cancellation. 

So I have a few questions:
1. Am I doing it right by using audio_processing? I mean do I really have to calculate the delay myself, did I miss something?

2. Recently I noticed that there is a function webrtc::EchoCancellation::GetDelayMetrics(). According to the description, I can get the delay by calling this function. So my understanding is that first I call this function and then feed the result delay to set_stream_delay_ms(). I did some tests using some recordings (pcm files), but it never give me the right delay and of course no echo was cancelled at all. Is my understanding about this function right?

3. I know there is a Voice Engine in WebRTC, and I had a look at the source code. It seems a upper layer than modules. So my understanding is that VOE calls functions in modules to do audio processing. I went through all functions in Voice Engine, I can see how to set or get the status of echo canceller or other audio processor, but I didn't find any function calling AnalyzeReverseStream and ProcessStream which is the place you really do the processing work. This is very confusing. If I am not using audio_processing in modules directly, how can I do the processing only with Voice Engine?

Thank you so much for your help!!


wilco...@gmail.com

unread,
Oct 3, 2014, 4:02:17 AM10/3/14
to discuss...@googlegroups.com
Hi,

I have the same questions. Did you find any answers?

I only want to use the VAD and echo cancellation.

krishna chaitanya

unread,
Apr 3, 2015, 2:28:16 PM4/3/15
to discuss...@googlegroups.com
Hi,

I am also facing the same issue. Pls help!!!
Thanls

Kaiduan Xie

unread,
Apr 3, 2015, 4:30:53 PM4/3/15
to discuss...@googlegroups.com

--

---
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.
For more options, visit https://groups.google.com/d/optout.

Pavel Baykov

unread,
Dec 17, 2015, 9:47:11 AM12/17/15
to discuss-webrtc
I have the same question, and i also found that there is   
   AecType::BasicWebRtcAecSettingsWithDelayAgnosticAec and AecType::BasicWebRtcAecSettingsWithAecMobile


new WebRTC code have DA-AEC (delay agnostic), will it work for Android?

GetDelayMetrics that you are referring too if i'm not mistaken read constant value from array either 50ms or 150ms

вторник, 19 августа 2014 г., 4:32:24 UTC+3 пользователь wenjing fan написал:
Reply all
Reply to author
Forward
0 new messages