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 21 matching lines...) Expand all Loading... | |
32 case VoiceDetection::kHighLikelihood: | 32 case VoiceDetection::kHighLikelihood: |
33 return 0; | 33 return 0; |
34 } | 34 } |
35 assert(false); | 35 assert(false); |
36 return -1; | 36 return -1; |
37 } | 37 } |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 VoiceDetectionImpl::VoiceDetectionImpl(const AudioProcessing* apm, | 40 VoiceDetectionImpl::VoiceDetectionImpl(const AudioProcessing* apm, |
41 CriticalSectionWrapper* crit) | 41 CriticalSectionWrapper* crit) |
42 : ProcessingComponent(), | 42 : ProcessingComponent(), |
hlundin-webrtc
2015/11/05 13:08:55
Not in this CL.
peah-webrtc
2015/11/06 07:31:14
It was initially included, but changes along the w
| |
43 apm_(apm), | 43 apm_(apm), |
44 crit_(crit), | 44 crit_(crit), |
45 stream_has_voice_(false), | 45 stream_has_voice_(false), |
46 using_external_vad_(false), | 46 using_external_vad_(false), |
47 likelihood_(kLowLikelihood), | 47 likelihood_(kLowLikelihood), |
48 frame_size_ms_(10), | 48 frame_size_ms_(10), |
49 frame_size_samples_(0) {} | 49 frame_size_samples_(0) {} |
50 | 50 |
51 VoiceDetectionImpl::~VoiceDetectionImpl() {} | 51 VoiceDetectionImpl::~VoiceDetectionImpl() {} |
52 | 52 |
53 int VoiceDetectionImpl::ProcessCaptureAudio(AudioBuffer* audio) { | 53 int VoiceDetectionImpl::ProcessCaptureAudio(AudioBuffer* audio) { |
54 if (!is_component_enabled()) { | 54 if (!is_component_enabled()) { |
55 return apm_->kNoError; | 55 return apm_->kNoError; |
56 } | 56 } |
57 | 57 |
58 if (using_external_vad_) { | 58 if (using_external_vad_) { |
59 using_external_vad_ = false; | 59 using_external_vad_ = false; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 int VoiceDetectionImpl::num_handles_required() const { | 167 int VoiceDetectionImpl::num_handles_required() const { |
168 return 1; | 168 return 1; |
169 } | 169 } |
170 | 170 |
171 int VoiceDetectionImpl::GetHandleError(void* handle) const { | 171 int VoiceDetectionImpl::GetHandleError(void* handle) const { |
172 // The VAD has no get_error() function. | 172 // The VAD has no get_error() function. |
173 assert(handle != NULL); | 173 assert(handle != NULL); |
174 return apm_->kUnspecifiedError; | 174 return apm_->kUnspecifiedError; |
175 } | 175 } |
176 } // namespace webrtc | 176 } // namespace webrtc |
OLD | NEW |