[Speex-dev] Echo cancellor on Windows, a few questions.

Ashhar Farhan farhan at phonestack.com
Wed Dec 5 06:33:03 PST 2007

what i want to achieve is simple, i want to be able to sitback in my chair 
and talk over a voip call using speex. as the mic and the speakers are 
built into the laptop, an echo canceller is required.

what i am doing is this :

First, each time i finish writing a block to the waveout, i copy it into a 
buffer like this:
 	Segment *pseg = (Segment *)phead;
 	waveOutUnprepareHeader(waveOut, phead, sizeof(WAVEHDR));
 	memcpy(remote, pseg->samples, 160 * sizeof(short));

Second, each time i get samples from the mic, i do the echo cancellation 
like this:
 	if (nsamples == 160){
 		speex_echo_cancellation(echo_state, (short *)pseg->samples, remote, unechoed);
 		q = unechoed;

I have also initialized the echo cancellor like this:
 	echo_state = speex_echo_state_init(160, 8000);

My issue is simply that the echo cancelleor is making almost no difference 
to my echo at all. any ideas?

Q1. is there a way to determine if the echo cancellor managed to lock in or not?

Q2. does anybody have a working code with wave apis?

Q3. is the speech processor necessary for the echo cancellor to work? what 
is the difference between 'echo' and the 'residual echo' that the 
preprocessor is suppoed to cancel?

  - farhan

More information about the Speex-dev mailing list