andrew@0: /* andrew@0: Copyright (C) 2003 Paul Brossier andrew@0: andrew@0: This program is free software; you can redistribute it and/or modify andrew@0: it under the terms of the GNU General Public License as published by andrew@0: the Free Software Foundation; either version 2 of the License, or andrew@0: (at your option) any later version. andrew@0: andrew@0: This program is distributed in the hope that it will be useful, andrew@0: but WITHOUT ANY WARRANTY; without even the implied warranty of andrew@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the andrew@0: GNU General Public License for more details. andrew@0: andrew@0: You should have received a copy of the GNU General Public License andrew@0: along with this program; if not, write to the Free Software andrew@0: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. andrew@0: andrew@0: */ andrew@0: andrew@0: #ifndef _RESAMPLE_H andrew@0: #define _RESAMPLE_H andrew@0: andrew@0: /** \file andrew@0: andrew@0: Resampling object andrew@0: andrew@0: This object resamples an input vector into an output vector using andrew@0: libsamplerate. See http://www.mega-nerd.com/SRC/ andrew@0: andrew@0: */ andrew@0: andrew@0: #ifdef __cplusplus andrew@0: extern "C" { andrew@0: #endif andrew@0: andrew@0: /** resampler object */ andrew@0: typedef struct _aubio_resampler_t aubio_resampler_t; andrew@0: /** create resampler object andrew@0: andrew@0: \param ratio output_sample_rate / input_sample_rate andrew@0: \param type libsamplerate resampling type andrew@0: andrew@0: */ andrew@0: aubio_resampler_t * new_aubio_resampler(float ratio, ba_uint_t type); andrew@0: /** delete resampler object */ andrew@0: void del_aubio_resampler(aubio_resampler_t *s); andrew@0: /** resample input in output andrew@0: andrew@0: \param s resampler object andrew@0: \param input input buffer of size N andrew@0: \param output output buffer of size N*ratio andrew@0: andrew@0: */ andrew@0: ba_uint_t aubio_resampler_process(aubio_resampler_t *s, fvec_t * input, fvec_t * output); andrew@0: andrew@0: #ifdef __cplusplus andrew@0: } andrew@0: #endif andrew@0: andrew@0: #endif /* _RESAMPLE_H */