[Speex-dev] Echo canceller

Francisco Puentes fpuentes at udc.es
Sat Aug 23 12:02:12 PDT 2008


I am using 'portaudio' and 'speex' to implement a speech audio
capture/playback.
Preprocess works fine but not the echo canceller (associated with
preprocessor).
I have read 'testecho.c' but it didn't help me.

What I am doing bad? This is my implementation:

One thread to capture and playback, both are different functions called in
different times directly from 'portaudio'.

On capture I do:
  
	speex_echo_cancellation(es,input,buffer,output);
		
		Input is the audio just captured
		Buffer is the last frame audio playbacked
		Output is obvious

On playback I do:

	speex_preprocess_run(ps,(spx_int16_t*)output);
	memcopy(buffer,output,settings.bufferSize());

		output is the frame audio to sound (different that the
'output' in capture)
		buffer store the last frame audio to be used later on
capture (look on capture)

Echo and preprocess states are conveniently initiated using
speex_echo_state_init(fpb,fpb*25) and
speex_echo_ctl(es,SPEEX_ECHO_SET_SAMPLING_RATE,&sr) (and, of course
speex_preprocess_state_init)

Echo state is associated with preprocess state using
SPEEX_PREPROCESS_SET_ECHO_STATE

What is wrong?





More information about the Speex-dev mailing list