Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: webrtc/audio/typing_noise_observer.cc

Issue 1403363003: Move VoiceEngineObserver into AudioSendStream so that we detect typing noises and return properly i… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: more includes Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/audio/typing_noise_observer.h ('k') | webrtc/audio/voice_engines.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/typing_noise_observer.cc
diff --git a/webrtc/audio/typing_noise_observer.cc b/webrtc/audio/typing_noise_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0e6faa8b303606869d82dae6c7549f06a06f4bb5
--- /dev/null
+++ b/webrtc/audio/typing_noise_observer.cc
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/audio/typing_noise_observer.h"
+
+#include "webrtc/base/checks.h"
+#include "webrtc/base/logging.h"
+#include "webrtc/voice_engine/include/voe_errors.h"
+
+namespace webrtc {
+namespace internal {
+
+void TypingNoiseObserver::CallbackOnError(int channel_id, int err_code) {
+ // All call sites in VoE, as of this writing, specify -1 as channel_id.
+ RTC_DCHECK(channel_id == -1);
+ LOG(LS_INFO) << "VoiceEngine error " << err_code << " reported on channel "
+ << channel_id << ".";
+ if (err_code == VE_TYPING_NOISE_WARNING) {
+ typing_noise_detected_ = true;
+ } else if (err_code == VE_TYPING_NOISE_OFF_WARNING) {
+ typing_noise_detected_ = false;
+ }
+}
+} // namespace internal
+} // namespace webrtc
« no previous file with comments | « webrtc/audio/typing_noise_observer.h ('k') | webrtc/audio/voice_engines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698