TGVOIP_NO_DSP should fully disable AEC

This commit is contained in:
infactum 2019-02-08 17:50:52 +05:00
parent e4989256a9
commit 806a3aec16
1 changed files with 5 additions and 0 deletions

View File

@ -144,6 +144,8 @@ void EchoCanceller::Enable(bool enabled){
} }
void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoice){ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoice){
#ifndef TGVOIP_NO_DSP
}
if(!isOn || (!enableAEC && !enableAGC && !enableNS)){ if(!isOn || (!enableAEC && !enableAGC && !enableNS)){
return; return;
} }
@ -165,6 +167,7 @@ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoi
hasVoice=hasVoice || apm->voice_detection()->stream_has_voice(); hasVoice=hasVoice || apm->voice_detection()->stream_has_voice();
} }
memcpy(inOut+480, audioFrame->data(), 480*2); memcpy(inOut+480, audioFrame->data(), 480*2);
#endif
} }
void EchoCanceller::SetAECStrength(int strength){ void EchoCanceller::SetAECStrength(int strength){
@ -182,7 +185,9 @@ void EchoCanceller::SetAECStrength(int strength){
void EchoCanceller::SetVoiceDetectionEnabled(bool enabled){ void EchoCanceller::SetVoiceDetectionEnabled(bool enabled){
enableVAD=enabled; enableVAD=enabled;
#ifndef TGVOIP_NO_DSP
apm->voice_detection()->Enable(enabled); apm->voice_detection()->Enable(enabled);
#endif
} }
using namespace tgvoip::effects; using namespace tgvoip::effects;