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

Unified Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 169803003: Adding typing detection to the APM in chrome. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move the typing detector to EnableTypingDetection() Created 6 years, 10 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 | « content/renderer/media/media_stream_audio_processor_options.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor_options.cc
diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc
index 1444ea7ce853ede1f97adb0eee278dd52665f144..c447404e868f4b9c53eab84dc2737bf795e9295a 100644
--- a/content/renderer/media/media_stream_audio_processor_options.cc
+++ b/content/renderer/media/media_stream_audio_processor_options.cc
@@ -14,6 +14,7 @@
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
+#include "third_party/webrtc/modules/audio_processing/typing_detection.h"
namespace content {
@@ -122,11 +123,15 @@ void EnableHighPassFilter(AudioProcessing* audio_processing) {
CHECK_EQ(audio_processing->high_pass_filter()->Enable(true), 0);
}
-void EnableTypingDetection(AudioProcessing* audio_processing) {
+void EnableTypingDetection(AudioProcessing* audio_processing,
+ webrtc::TypingDetection* typing_detector) {
int err = audio_processing->voice_detection()->Enable(true);
err |= audio_processing->voice_detection()->set_likelihood(
webrtc::VoiceDetection::kVeryLowLikelihood);
CHECK_EQ(err, 0);
+
+ // Configure the update period to 100ms (10 * 10ms) in the typing detector.
+ typing_detector->SetParameters(0, 0, 0, 0, 0, 10);
}
void EnableExperimentalEchoCancellation(AudioProcessing* audio_processing) {
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_options.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698