[96fb8ad] | 1 | /* |
---|
[4598946] | 2 | Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> |
---|
[e6a78ea] | 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 | |
---|
[96fb8ad] | 19 | */ |
---|
| 20 | |
---|
[6f42c16] | 21 | #ifndef AUBIO_RESAMPLER_H |
---|
| 22 | #define AUBIO_RESAMPLER_H |
---|
[96fb8ad] | 23 | |
---|
[ca29f57] | 24 | /** \file |
---|
[4598946] | 25 | |
---|
[ca29f57] | 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/ |
---|
[4598946] | 30 | |
---|
[ca29f57] | 31 | */ |
---|
[96fb8ad] | 32 | |
---|
| 33 | #ifdef __cplusplus |
---|
| 34 | extern "C" { |
---|
| 35 | #endif |
---|
| 36 | |
---|
[ca29f57] | 37 | /** resampler object */ |
---|
[96fb8ad] | 38 | typedef struct _aubio_resampler_t aubio_resampler_t; |
---|
[06f2d78] | 39 | |
---|
[4598946] | 40 | /** create resampler object |
---|
[ca29f57] | 41 | |
---|
[4598946] | 42 | \param ratio output_sample_rate / input_sample_rate |
---|
[c43c459] | 43 | \param type libsamplerate resampling type, see http://www.mega-nerd.com/SRC/api_misc.html#Converters |
---|
[ca29f57] | 44 | |
---|
| 45 | */ |
---|
[bafe71d] | 46 | aubio_resampler_t *new_aubio_resampler (smpl_t ratio, uint_t type); |
---|
[06f2d78] | 47 | |
---|
[96fb8ad] | 48 | /** delete resampler object */ |
---|
[bafe71d] | 49 | void del_aubio_resampler (aubio_resampler_t * s); |
---|
[06f2d78] | 50 | |
---|
[ca29f57] | 51 | /** resample input in output |
---|
| 52 | |
---|
| 53 | \param s resampler object |
---|
| 54 | \param input input buffer of size N |
---|
| 55 | \param output output buffer of size N*ratio |
---|
| 56 | |
---|
| 57 | */ |
---|
[23493b5] | 58 | void aubio_resampler_do (aubio_resampler_t * s, const fvec_t * input, |
---|
[bafe71d] | 59 | fvec_t * output); |
---|
[96fb8ad] | 60 | |
---|
| 61 | #ifdef __cplusplus |
---|
| 62 | } |
---|
| 63 | #endif |
---|
| 64 | |
---|
[6f42c16] | 65 | #endif /* AUBIO_RESAMPLER_H */ |
---|