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

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

Issue 1227213002: Update audio code to use size_t more correctly, webrtc/modules/audio_processing/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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/voice_detection_impl.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 /* 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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/voice_detection_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698