Frame length of 10ms - is this crucial?

773 views
Skip to first unread message

Alexander Shmuratko

unread,
Dec 26, 2011, 4:32:28 AM12/26/11
to discuss-webrtc
I need to use just part of WebRTC - echo cancellation. So I look at
the audio processing module (APM). In "audio_processing.h" it says:
"APM accepts only 16-bit linear PCM audio data in frames of 10 ms". I
wonder if 10ms requirement is crucial and why. Could anybody explain,
please?

Randell Jesup

unread,
Dec 26, 2011, 12:37:13 PM12/26/11
to discuss...@googlegroups.com

Audio chains are typically block-oriented, and often aren't designed to
be adjustable in terms of frame size. However, the internal processing
frame size is not the same as the packetization interval used for audio
packets in RTP, which is typically (but not always) a multiple of 10ms.
(20ms is the most common).

--
Randell Jesup
randel...@jesup.org

Alexander Shmuratko

unread,
Dec 27, 2011, 4:12:01 AM12/27/11
to discuss-webrtc
Sorry if I misunderstood, does that mean that longer frames (say, 48
ms) are impossible?

Once again, I mean to work only with the echo cancellation algorithm
("audio_processing.h" etc.). Networking, coding/decoding is my own. We
have 48ms frames (this is not going to change, unfortunately). And I
wondered if I could adapt WebRTC echo cancellation to my system.

I looked into the WebRTC code working with frames to cancel echo. The
length of 10ms (= 80 samples for 8kHz rate) seems to be set through
several constants in the code. So I hope I'd be able to carefully
adapt the code to my needs. Is it possible?

Randell Jesup

unread,
Dec 27, 2011, 4:31:07 AM12/27/11
to discuss...@googlegroups.com
On 12/27/2011 4:12 AM, Alexander Shmuratko wrote:
> Sorry if I misunderstood, does that mean that longer frames (say, 48
> ms) are impossible?
>
> Once again, I mean to work only with the echo cancellation algorithm
> ("audio_processing.h" etc.). Networking, coding/decoding is my own. We
> have 48ms frames (this is not going to change, unfortunately). And I
> wondered if I could adapt WebRTC echo cancellation to my system.

You can adapt by either modifying the code for 48ms (or some divisor of
it, like 12ms), or by re-buffering the data into 10ms chunks to feed to
the AEC, and back to 48ms chunks afterwards (would work but would add a
small amount of delay).

> I looked into the WebRTC code working with frames to cancel echo. The
> length of 10ms (= 80 samples for 8kHz rate) seems to be set through
> several constants in the code. So I hope I'd be able to carefully
> adapt the code to my needs. Is it possible?

Maybe (I'd guess yes, but it might be a fair bit of work depending on
how completely things are parameterized). You'll have to see, and I'm
afraid the Google people won't be able to help you from what they've
said in the past.

--
Randell Jesup
randel...@jesup.org

Alexander Shmuratko

unread,
Dec 27, 2011, 4:38:03 AM12/27/11
to discuss-webrtc
Thanks, Randell. I'll give it a try.

bin ma

unread,
Jan 10, 2012, 3:33:43 AM1/10/12
to discuss-webrtc
or by re-buffering the data into 10ms chunks to feed to
the AEC, and back to 48ms chunks afterwards (would work but would add
a
small amount of delay).
------------------------
It works well。
> randell-i...@jesup.org
Reply all
Reply to author
Forward
0 new messages