Skip to content
Snippets Groups Projects
Commit 303fde7e authored by Alexandre Savard's avatar Alexandre Savard
Browse files

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

parent d5fc9716
No related branches found
No related tags found
No related merge requests found
...@@ -973,9 +973,6 @@ void AlsaLayer::audioCallback(void) ...@@ -973,9 +973,6 @@ void AlsaLayer::audioCallback(void)
// to avoid such problem // to avoid such problem
AudioLayer::_echoCancel->setSamplingRate(_mainBufferSampleRate); AudioLayer::_echoCancel->setSamplingRate(_mainBufferSampleRate);
// Copy far-end signal in echo canceller to adapt filter coefficient
AudioLayer::_echoCanceller->putData(out, toGet);
if (_mainBufferSampleRate && ( (int) _audioSampleRate != _mainBufferSampleRate)) { if (_mainBufferSampleRate && ( (int) _audioSampleRate != _mainBufferSampleRate)) {
...@@ -999,6 +996,9 @@ void AlsaLayer::audioCallback(void) ...@@ -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 { } else {
if (!tone && !file_tone) { if (!tone && !file_tone) {
...@@ -1099,7 +1099,9 @@ void AlsaLayer::audioCallback(void) ...@@ -1099,7 +1099,9 @@ void AlsaLayer::audioCallback(void)
} else { } else {
getMainBuffer()->putData (in, toPut, 100); int sampleready = AudioLayer::_echoCanceller->processAudio(in, echoCancelledMic, toPut);
getMainBuffer()->putData (echoCancelledMic, sampleready*sizeof(SFLDataFormat), 100);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment