[Speex-dev] echo cancellation

Alfredo Moreira
Thu, 30 Dec 2004 12:36:23 -0000

I'm going to test the echo cancellation...
but before doing something wrong, i want to know what is the right way
to use it...

-------------------------------------------------------------------------------------
short * speakerSample; //will contain what the speakers are going to play
short * microphoneSample; //what the microphone is going to register
short*  cancelledSample; //the ouput without echo
int*      cancelledSpectrum; //output cancelled spectrum

//now i assume that i should initialise everything like that:

SpeexEchoState* pechoState = speex_echo_state_init(160,x*160); //do the
second parameter need to be a multiple of the frame size?
AllocBuffers(SpeakerSample,microphoneSample,cancelledSample,cancelledSpectrum);

do{
captureSpeaker(speakerSample);
captureMicrophone(microphoneSample);
speex_echo_cancel(pechoState, microphoneSample, speakerSample,
cancelledSample, cancelledSpectrum);
while (!keypressed());

-------------------------------------------------------------------------------------

so, do i need to deal with the cancelledSpectrum variable to perform
echo cancellation in a proper way?
do i need to deal with the delay between the sound being registered by
the microphone and the one going out of the speakers? (i don't know you
anderstand what i mean, sorry for my poor english)
also, there is an echo parameter to the preprocess function : int
speex_preprocess(SpeexPreprocessState *st, short *x, int *echo);
do i need to provide to it my cancelledSpectrum variable?

best regards,
fredo





--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.6 - Release Date: 28/12/2004