<meta charset="utf-8"><span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre>>><i> Hi,
</i>>><i>
</i><meta charset="utf-8">>><i> I have a scenario in a mobile VoIP app that requires echo cancellation but
</i><meta charset="utf-8">>><i> is somewhat different from what's described in the docs.
</i><meta charset="utf-8">>><i>
</i><meta charset="utf-8">>><i> Audio is received from and sent to the network at 8000Hz. Each packet
</i><meta charset="utf-8">>><i> contains 160 samples worth a playback of 20ms.
</i><meta charset="utf-8">>><i>
</i><meta charset="utf-8">>><i> But the hardware requires aggregation for both playback and capture. So for
</i><meta charset="utf-8">>><i> playback, I coalesce 4 packets in a buffer and queue them as a larger buffer
</i><meta charset="utf-8">>><i> for playback.
</i><meta charset="utf-8">>><i> On the send side, I read a large buffer (worth 4 packets) and send them out
</i><meta charset="utf-8">>><i> over time 20ms apart.
</i><meta charset="utf-8">>><i>
</i><meta charset="utf-8">>><i> I tried using speex_echo_playback just when a 160-sample packet arrives from
</i><meta charset="utf-8">>><i> the network, before coalescing and speex_echo_capture just before a packet
</i><meta charset="utf-8">>><i> is sent out to the network but that doesn't seem to work properly (doesn't
</i><meta charset="utf-8">>><i> cancel any echo).
</i>
<meta charset="utf-8">> The most likely reason is that you didn't align the far-end and near-end samples.
<meta charset="utf-8">> So the filter can not converge.
<br></pre><pre>Thanks for your response. Can you please explain what you mean by align samples from near-end and far-end? And how is that usually accomplished?</pre><pre><meta charset="utf-8">>><i> So, in this scenario above, please recommend a good place to insert
</i><meta charset="utf-8">>><i> speex_echo_playback and speex_echo_capture. Should I be just before the read
</i><meta charset="utf-8">>><i> and write to hardware? In that case, should I use a larger "frame size" of
</i><meta charset="utf-8">>><i> 160 samples x 4?
</i>
<meta charset="utf-8">> Of course you can set frame size to 160*4. Otherwise you can feed samples 4 times
<meta charset="utf-8">> to the AEC if you don't want to modify the frame size.
><i>
</i>><i> Thanks in advance,
</i>><i> Daniel.</i><i> </i></pre></span>