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

Side by Side Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 2554823002: Change to use the new API in the audio processing module for enabling the high-pass filter effect (Closed)
Patch Set: Created 4 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/media_stream_audio_processor_options.h" 5 #include "content/renderer/media/media_stream_audio_processor_options.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 CHECK_EQ(err, 0); 404 CHECK_EQ(err, 0);
405 } 405 }
406 406
407 void EnableNoiseSuppression(AudioProcessing* audio_processing, 407 void EnableNoiseSuppression(AudioProcessing* audio_processing,
408 webrtc::NoiseSuppression::Level ns_level) { 408 webrtc::NoiseSuppression::Level ns_level) {
409 int err = audio_processing->noise_suppression()->set_level(ns_level); 409 int err = audio_processing->noise_suppression()->set_level(ns_level);
410 err |= audio_processing->noise_suppression()->Enable(true); 410 err |= audio_processing->noise_suppression()->Enable(true);
411 CHECK_EQ(err, 0); 411 CHECK_EQ(err, 0);
412 } 412 }
413 413
414 void EnableHighPassFilter(AudioProcessing* audio_processing) {
415 CHECK_EQ(audio_processing->high_pass_filter()->Enable(true), 0);
416 }
417
418 void EnableTypingDetection(AudioProcessing* audio_processing, 414 void EnableTypingDetection(AudioProcessing* audio_processing,
419 webrtc::TypingDetection* typing_detector) { 415 webrtc::TypingDetection* typing_detector) {
420 int err = audio_processing->voice_detection()->Enable(true); 416 int err = audio_processing->voice_detection()->Enable(true);
421 err |= audio_processing->voice_detection()->set_likelihood( 417 err |= audio_processing->voice_detection()->set_likelihood(
422 webrtc::VoiceDetection::kVeryLowLikelihood); 418 webrtc::VoiceDetection::kVeryLowLikelihood);
423 CHECK_EQ(err, 0); 419 CHECK_EQ(err, 0);
424 420
425 // Configure the update period to 1s (100 * 10ms) in the typing detector. 421 // Configure the update period to 1s (100 * 10ms) in the typing detector.
426 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); 422 typing_detector->SetParameters(0, 0, 0, 0, 0, 100);
427 } 423 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 477
482 // Give preference to the audio constraint over the device-supplied mic 478 // Give preference to the audio constraint over the device-supplied mic
483 // positions. This is mainly for testing purposes. 479 // positions. This is mainly for testing purposes.
484 return WebrtcPointsFromMediaPoints( 480 return WebrtcPointsFromMediaPoints(
485 constraints_geometry.empty() 481 constraints_geometry.empty()
486 ? input_params.mic_positions 482 ? input_params.mic_positions
487 : media::ParsePointsFromString(constraints_geometry)); 483 : media::ParsePointsFromString(constraints_geometry));
488 } 484 }
489 485
490 } // namespace content 486 } // namespace content
OLDNEW
« 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