Skip to content

Commit

Permalink
Use methods from updated webrtc.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jan 1, 2021
1 parent 37d98e9 commit 13a5fcb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions EchoCanceller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#ifndef TGVOIP_NO_DSP
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/audio_processing/include/audio_frame_proxies.h"
#include "api/audio/audio_frame.h"
#endif

Expand Down Expand Up @@ -151,9 +152,9 @@ void EchoCanceller::RunBufferFarendThread(){
int16_t* samplesIn=farendQueue->GetBlocking();
if(samplesIn){
memcpy(frame.mutable_data(), samplesIn, 480*2);
apm->ProcessReverseStream(&frame);
webrtc::ProcessReverseAudioFrame(apm, &frame);
memcpy(frame.mutable_data(), samplesIn+480, 480*2);
apm->ProcessReverseStream(&frame);
webrtc::ProcessReverseAudioFrame(apm, &frame);
didBufferFarend=true;
farendBufferPool->Reuse(reinterpret_cast<unsigned char*>(samplesIn));
}
Expand All @@ -176,7 +177,7 @@ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoi
memcpy(audioFrame->mutable_data(), inOut, 480*2);
if(enableAEC)
apm->set_stream_delay_ms(delay);
apm->ProcessStream(audioFrame);
webrtc::ProcessAudioFrame(apm, audioFrame);
if(enableVAD)
#ifdef TGVOIP_USE_DESKTOP_DSP_BUNDLED
hasVoice=apm->voice_detection()->stream_has_voice();
Expand All @@ -187,7 +188,7 @@ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoi
memcpy(audioFrame->mutable_data(), inOut+480, 480*2);
if(enableAEC)
apm->set_stream_delay_ms(delay);
apm->ProcessStream(audioFrame);
webrtc::ProcessAudioFrame(apm, audioFrame);
if(enableVAD){
#ifdef TGVOIP_USE_DESKTOP_DSP_BUNDLED
hasVoice=hasVoice || apm->voice_detection()->stream_has_voice();
Expand Down

0 comments on commit 13a5fcb

Please sign in to comment.