OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |