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

Side by Side Diff: webrtc/common_audio/vad/include/webrtc_vad.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (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/common_audio/sparse_fir_filter_unittest.cc ('k') | webrtc/common_audio/vad/vad.cc » ('j') | 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
11 11
12 /* 12 /*
13 * This header file includes the VAD API calls. Specific function calls are give n below. 13 * This header file includes the VAD API calls. Specific function calls are give n below.
14 */ 14 */
15 15
16 #ifndef WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ // NOLINT 16 #ifndef WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ // NOLINT
17 #define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ 17 #define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_
18 18
19 #include <stddef.h>
20
19 #include "webrtc/typedefs.h" 21 #include "webrtc/typedefs.h"
20 22
21 typedef struct WebRtcVadInst VadInst; 23 typedef struct WebRtcVadInst VadInst;
22 24
23 #ifdef __cplusplus 25 #ifdef __cplusplus
24 extern "C" { 26 extern "C" {
25 #endif 27 #endif
26 28
27 // Creates an instance to the VAD structure. 29 // Creates an instance to the VAD structure.
28 VadInst* WebRtcVad_Create(); 30 VadInst* WebRtcVad_Create();
(...skipping 30 matching lines...) Expand all
59 // - handle [i/o] : VAD Instance. Needs to be initialized by 61 // - handle [i/o] : VAD Instance. Needs to be initialized by
60 // WebRtcVad_Init() before call. 62 // WebRtcVad_Init() before call.
61 // - fs [i] : Sampling frequency (Hz): 8000, 16000, or 32000 63 // - fs [i] : Sampling frequency (Hz): 8000, 16000, or 32000
62 // - audio_frame [i] : Audio frame buffer. 64 // - audio_frame [i] : Audio frame buffer.
63 // - frame_length [i] : Length of audio frame buffer in number of samples. 65 // - frame_length [i] : Length of audio frame buffer in number of samples.
64 // 66 //
65 // returns : 1 - (Active Voice), 67 // returns : 1 - (Active Voice),
66 // 0 - (Non-active Voice), 68 // 0 - (Non-active Voice),
67 // -1 - (Error) 69 // -1 - (Error)
68 int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, 70 int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame,
69 int frame_length); 71 size_t frame_length);
70 72
71 // Checks for valid combinations of |rate| and |frame_length|. We support 10, 73 // Checks for valid combinations of |rate| and |frame_length|. We support 10,
72 // 20 and 30 ms frames and the rates 8000, 16000 and 32000 Hz. 74 // 20 and 30 ms frames and the rates 8000, 16000 and 32000 Hz.
73 // 75 //
74 // - rate [i] : Sampling frequency (Hz). 76 // - rate [i] : Sampling frequency (Hz).
75 // - frame_length [i] : Speech frame buffer length in number of samples. 77 // - frame_length [i] : Speech frame buffer length in number of samples.
76 // 78 //
77 // returns : 0 - (valid combination), -1 - (invalid combination) 79 // returns : 0 - (valid combination), -1 - (invalid combination)
78 int WebRtcVad_ValidRateAndFrameLength(int rate, int frame_length); 80 int WebRtcVad_ValidRateAndFrameLength(int rate, size_t frame_length);
79 81
80 #ifdef __cplusplus 82 #ifdef __cplusplus
81 } 83 }
82 #endif 84 #endif
83 85
84 #endif // WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ // NOLINT 86 #endif // WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ // NOLINT
OLDNEW
« no previous file with comments | « webrtc/common_audio/sparse_fir_filter_unittest.cc ('k') | webrtc/common_audio/vad/vad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698