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

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

Issue 141513006: Wire up AGC to the MediaStreamAudioProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uploaded again Created 6 years, 11 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
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 cffc5a17e2c699d84fdb76e18b42036660bfed7a..51f52abb132187e37c84e62bec800123227ab220 100644
--- a/content/renderer/media/media_stream_audio_processor_options.cc
+++ b/content/renderer/media/media_stream_audio_processor_options.cc
@@ -39,10 +39,8 @@ struct {
webrtc::MediaConstraintsInterface::kValueTrue },
{ webrtc::MediaConstraintsInterface::kHighpassFilter,
webrtc::MediaConstraintsInterface::kValueTrue },
- // TODO(xians): Verify if it is OK to set typing detection to kValueFalse as
- // default.
{ webrtc::MediaConstraintsInterface::kTypingNoiseDetection,
- webrtc::MediaConstraintsInterface::kValueFalse },
+ webrtc::MediaConstraintsInterface::kValueTrue },
};
} // namespace
@@ -122,7 +120,6 @@ void EnableHighPassFilter(AudioProcessing* audio_processing) {
CHECK_EQ(audio_processing->high_pass_filter()->Enable(true), 0);
}
-// TODO(xians): stereo swapping
void EnableTypingDetection(AudioProcessing* audio_processing) {
int err = audio_processing->voice_detection()->Enable(true);
err |= audio_processing->voice_detection()->set_likelihood(
@@ -163,4 +160,15 @@ void StopAecDump(AudioProcessing* audio_processing) {
DLOG(ERROR) << "Fail to stop AEC debug recording";
}
+void EnableAutomaticGainControl(AudioProcessing* audio_processing) {
+#if defined(OS_ANDROID) || defined(OS_IOS)
+ const webrtc::GainControl::Mode mode = webrtc::GainControl::kAdaptiveAnalog;
+#else
+ const webrtc::GainControl::Mode mode = webrtc::GainControl::kAdaptiveAnalog;
+#endif
+ int err = audio_processing->gain_control()->set_mode(mode);
+ err |= audio_processing->gain_control()->Enable(true);
+ CHECK_EQ(err, 0);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698