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

Side by Side Diff: webrtc/modules/audio_processing/voice_detection_impl.cc

Issue 2320053003: webrtc/modules/audio_processing: Use RTC_DCHECK() instead of assert() (Closed)
Patch Set: rebase Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_processing/vad/vad_circular_buffer.cc ('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 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 int VoiceDetectionImpl::set_stream_has_voice(bool has_voice) { 96 int VoiceDetectionImpl::set_stream_has_voice(bool has_voice) {
97 rtc::CritScope cs(crit_); 97 rtc::CritScope cs(crit_);
98 using_external_vad_ = true; 98 using_external_vad_ = true;
99 stream_has_voice_ = has_voice; 99 stream_has_voice_ = has_voice;
100 return AudioProcessing::kNoError; 100 return AudioProcessing::kNoError;
101 } 101 }
102 102
103 bool VoiceDetectionImpl::stream_has_voice() const { 103 bool VoiceDetectionImpl::stream_has_voice() const {
104 rtc::CritScope cs(crit_); 104 rtc::CritScope cs(crit_);
105 // TODO(ajm): enable this assertion? 105 // TODO(ajm): enable this assertion?
106 //assert(using_external_vad_ || is_component_enabled()); 106 //RTC_DCHECK(using_external_vad_ || is_component_enabled());
107 return stream_has_voice_; 107 return stream_has_voice_;
108 } 108 }
109 109
110 int VoiceDetectionImpl::set_likelihood(VoiceDetection::Likelihood likelihood) { 110 int VoiceDetectionImpl::set_likelihood(VoiceDetection::Likelihood likelihood) {
111 rtc::CritScope cs(crit_); 111 rtc::CritScope cs(crit_);
112 likelihood_ = likelihood; 112 likelihood_ = likelihood;
113 if (enabled_) { 113 if (enabled_) {
114 int mode = 2; 114 int mode = 2;
115 switch (likelihood) { 115 switch (likelihood) {
116 case VoiceDetection::kVeryLowLikelihood: 116 case VoiceDetection::kVeryLowLikelihood:
(...skipping 29 matching lines...) Expand all
146 frame_size_ms_ = size; 146 frame_size_ms_ = size;
147 Initialize(sample_rate_hz_); 147 Initialize(sample_rate_hz_);
148 return AudioProcessing::kNoError; 148 return AudioProcessing::kNoError;
149 } 149 }
150 150
151 int VoiceDetectionImpl::frame_size_ms() const { 151 int VoiceDetectionImpl::frame_size_ms() const {
152 rtc::CritScope cs(crit_); 152 rtc::CritScope cs(crit_);
153 return frame_size_ms_; 153 return frame_size_ms_;
154 } 154 }
155 } // namespace webrtc 155 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/vad/vad_circular_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698