diff options
author | niklas.enbom@webrtc.org <niklas.enbom@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-05-07 21:04:24 +0000 |
---|---|---|
committer | niklas.enbom@webrtc.org <niklas.enbom@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-05-07 21:04:24 +0000 |
commit | 28832e1965ca0c22ca6a26bbd3387db4db640bed (patch) | |
tree | d737ce9e0b8ba5260122fa3e9f28fc1001326fa3 /voice_engine/transmit_mixer.cc | |
parent | 06ad384100b8b493e4a3f37877caac520189fec3 (diff) | |
download | webrtc-28832e1965ca0c22ca6a26bbd3387db4db640bed.tar.gz |
Refactoring for typing detection
R=henrika@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1370004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3976 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/transmit_mixer.cc')
-rw-r--r-- | voice_engine/transmit_mixer.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/voice_engine/transmit_mixer.cc b/voice_engine/transmit_mixer.cc index ea35afb9..3af2603e 100644 --- a/voice_engine/transmit_mixer.cc +++ b/voice_engine/transmit_mixer.cc @@ -332,7 +332,8 @@ TransmitMixer::PrepareDemux(const void* audioSamples, const uint32_t samplesPerSec, const uint16_t totalDelayMS, const int32_t clockDrift, - const uint16_t currentMicLevel) + const uint16_t currentMicLevel, + const bool keyPressed) { WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1), "TransmitMixer::PrepareDemux(nSamples=%u, nChannels=%u," @@ -369,7 +370,7 @@ TransmitMixer::PrepareDemux(const void* audioSamples, // --- Annoying typing detection (utilizes the APM/VAD decision) #ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION - TypingDetection(); + TypingDetection(keyPressed); #endif // --- Mute during DTMF tone if direct feedback is enabled @@ -1327,7 +1328,7 @@ void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, } #ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION -int TransmitMixer::TypingDetection() +int TransmitMixer::TypingDetection(const bool keyPressed) { // We let the VAD determine if we're using this feature or not. @@ -1336,13 +1337,6 @@ int TransmitMixer::TypingDetection() return (0); } - int keyPressed = EventWrapper::KeyPressed(); - - if (keyPressed < 0) - { - return (-1); - } - if (_audioFrame.vad_activity_ == AudioFrame::kVadActive) _timeActive++; else |