Commit 303fde7e authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#1966] Add echocancel in non-resampled alsa capture process

parent d5fc9716
......@@ -971,10 +971,7 @@ void AlsaLayer::audioCallback(void)
// TODO: Audio processing should be performed inside mainbuffer
// to avoid such problem
AudioLayer::_echoCancel->setSamplingRate(_mainBufferSampleRate);
// Copy far-end signal in echo canceller to adapt filter coefficient
AudioLayer::_echoCanceller->putData(out, toGet);
AudioLayer::_echoCancel->setSamplingRate(_mainBufferSampleRate);
if (_mainBufferSampleRate && ( (int) _audioSampleRate != _mainBufferSampleRate)) {
......@@ -999,6 +996,9 @@ void AlsaLayer::audioCallback(void)
}
// Copy far-end signal in echo canceller to adapt filter coefficient
AudioLayer::_echoCanceller->putData(out, toGet);
} else {
if (!tone && !file_tone) {
......@@ -1099,7 +1099,9 @@ void AlsaLayer::audioCallback(void)
} else {
getMainBuffer()->putData (in, toPut, 100);
int sampleready = AudioLayer::_echoCanceller->processAudio(in, echoCancelledMic, toPut);
getMainBuffer()->putData (echoCancelledMic, sampleready*sizeof(SFLDataFormat), 100);
}
}
......
Supports Markdown
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