1 | /* |
---|
2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
3 | |
---|
4 | This file is part of aubio. |
---|
5 | |
---|
6 | aubio is free software: you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation, either version 3 of the License, or |
---|
9 | (at your option) any later version. |
---|
10 | |
---|
11 | aubio is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _RESAMPLE_H |
---|
22 | #define _RESAMPLE_H |
---|
23 | |
---|
24 | /** \file |
---|
25 | |
---|
26 | Resampling object |
---|
27 | |
---|
28 | This object resamples an input vector into an output vector using |
---|
29 | libsamplerate. See http://www.mega-nerd.com/SRC/ |
---|
30 | |
---|
31 | */ |
---|
32 | |
---|
33 | #if HAVE_SAMPLERATE |
---|
34 | |
---|
35 | #ifdef __cplusplus |
---|
36 | extern "C" { |
---|
37 | #endif |
---|
38 | |
---|
39 | /** resampler object */ |
---|
40 | typedef struct _aubio_resampler_t aubio_resampler_t; |
---|
41 | |
---|
42 | /** create resampler object |
---|
43 | |
---|
44 | \param ratio output_sample_rate / input_sample_rate |
---|
45 | \param type libsamplerate resampling type |
---|
46 | |
---|
47 | */ |
---|
48 | aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type); |
---|
49 | |
---|
50 | /** delete resampler object */ |
---|
51 | void del_aubio_resampler(aubio_resampler_t *s); |
---|
52 | |
---|
53 | /** resample input in output |
---|
54 | |
---|
55 | \param s resampler object |
---|
56 | \param input input buffer of size N |
---|
57 | \param output output buffer of size N*ratio |
---|
58 | |
---|
59 | */ |
---|
60 | void aubio_resampler_do (aubio_resampler_t *s, fvec_t * input, fvec_t * output); |
---|
61 | |
---|
62 | #ifdef __cplusplus |
---|
63 | } |
---|
64 | #endif |
---|
65 | |
---|
66 | #endif /* HAVE_SAMPLERATE */ |
---|
67 | |
---|
68 | #endif /* _RESAMPLE_H */ |
---|