Commit dd6a42c6 authored by Alexandre Savard's avatar Alexandre Savard

#5814: Implement speex post echo canceller processing

parent 15535526
......@@ -40,8 +40,8 @@ SpeexEchoCancel::SpeexEchoCancel()
_echoTailLength = echoTailLengthMs * samplingRate / 1000;
// _echoState = speex_echo_state_init (EC_FRAME_SIZE, EC_FILTER_LENGTH);
_echoState = speex_echo_state_init (EC_FRAME_SIZE, _echoTailLength);
_preState = speex_preprocess_state_init (EC_FRAME_SIZE, samplingRate);
_echoState = speex_echo_state_init (EC_FRAME_SIZE * sizeof(SFLDataFormat), _echoTailLength);
_preState = speex_preprocess_state_init (EC_FRAME_SIZE * sizeof(SFLDataFormat), samplingRate);
_debug("EchoCancel: Initializing echo canceller with delay: %d, filter length: %d, frame size: %d and samplerate %d",
_echoDelay, _echoTailLength, EC_FRAME_SIZE, samplingRate);
......@@ -158,6 +158,7 @@ int SpeexEchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputDat
// Processed echo cancellation
speex_echo_cancellation (_echoState, _tmpMic, _tmpSpkr, _tmpOut);
speex_preprocess_run(_preState, reinterpret_cast<short *>(_tmpOut));
echoFile->write(reinterpret_cast<char *>(_tmpOut), byteSize);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment