[Speex-dev] trouble getting speex_echo_cancel() to work

Thorvald Natvig speex at natvig.com
Tue May 31 14:38:41 PDT 2005

I'm trying to convert my current headphones and microphone chat 
application to support loudspeakers and microphone, and so I thought I'd 
give speex_echo_cancel() a try.

Since my users quite frequently have other sound-producing applications 
running on their computer (such as winamp), I sample 'wave' recording 
device of the soundcard in addition to the microphone.

I then call speex_echo_cancel() as

speex_echo_cancel(st, data sampled from microphone device, data sampled 
from output of soundcard, output pointer, y-buffer)

.. which as I understand it should be correct?

I've gone to some effort to make sure that the two sets of sampled data 
are from the exact same time (seems my two soundcards don't sample 32khz 
at the exact same rate, they differ by about 0.1%), but it doesn't remove 
any of the echo, it just provides some weird artifacts in addition to the 
original signal.

I'm using a framesize of 640, the same as the speex framesize at 32khz 
uwb, and tested this with speex 1.1.8

If anyone has some idea on what I'm doing wrong, please let me know :)

More information about the Speex-dev mailing list