| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return frame_size_ms_; | 133 return frame_size_ms_; |
| 134 } | 134 } |
| 135 | 135 |
| 136 int VoiceDetectionImpl::Initialize() { | 136 int VoiceDetectionImpl::Initialize() { |
| 137 int err = ProcessingComponent::Initialize(); | 137 int err = ProcessingComponent::Initialize(); |
| 138 if (err != apm_->kNoError || !is_component_enabled()) { | 138 if (err != apm_->kNoError || !is_component_enabled()) { |
| 139 return err; | 139 return err; |
| 140 } | 140 } |
| 141 | 141 |
| 142 using_external_vad_ = false; | 142 using_external_vad_ = false; |
| 143 frame_size_samples_ = frame_size_ms_ * | 143 frame_size_samples_ = static_cast<size_t>( |
| 144 apm_->proc_split_sample_rate_hz() / 1000; | 144 frame_size_ms_ * apm_->proc_split_sample_rate_hz() / 1000); |
| 145 // TODO(ajm): intialize frame buffer here. | 145 // TODO(ajm): intialize frame buffer here. |
| 146 | 146 |
| 147 return apm_->kNoError; | 147 return apm_->kNoError; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void* VoiceDetectionImpl::CreateHandle() const { | 150 void* VoiceDetectionImpl::CreateHandle() const { |
| 151 return WebRtcVad_Create(); | 151 return WebRtcVad_Create(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void VoiceDetectionImpl::DestroyHandle(void* handle) const { | 154 void VoiceDetectionImpl::DestroyHandle(void* handle) const { |
| (...skipping 12 matching lines...) Expand all 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 |