aubio  0.4.1
temporal/resampler.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
00003 
00004   This file is part of aubio.
00005 
00006   aubio is free software: you can redistribute it and/or modify
00007   it under the terms of the GNU General Public License as published by
00008   the Free Software Foundation, either version 3 of the License, or
00009   (at your option) any later version.
00010 
00011   aubio is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014   GNU General Public License for more details.
00015 
00016   You should have received a copy of the GNU General Public License
00017   along with aubio.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 #ifndef _AUBIO_RESAMPLER_H
00022 #define _AUBIO_RESAMPLER_H
00023 
00024 /** \file
00025  
00026  Resampling object
00027 
00028  This object resamples an input vector into an output vector using
00029  libsamplerate. See http://www.mega-nerd.com/SRC/
00030  
00031 */
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 /** resampler object */
00038 typedef struct _aubio_resampler_t aubio_resampler_t;
00039 
00040 /** create resampler object 
00041 
00042   \param ratio output_sample_rate / input_sample_rate 
00043   \param type libsamplerate resampling type, see http://www.mega-nerd.com/SRC/api_misc.html#Converters
00044 
00045 */
00046 aubio_resampler_t *new_aubio_resampler (smpl_t ratio, uint_t type);
00047 
00048 /** delete resampler object */
00049 void del_aubio_resampler (aubio_resampler_t * s);
00050 
00051 /** resample input in output
00052 
00053   \param s resampler object
00054   \param input input buffer of size N
00055   \param output output buffer of size N*ratio
00056 
00057 */
00058 void aubio_resampler_do (aubio_resampler_t * s, fvec_t * input,
00059     fvec_t * output);
00060 
00061 #ifdef __cplusplus
00062 }
00063 #endif
00064 
00065 #endif /* _AUBIO_RESAMPLER_H */
 All Data Structures Files Functions Variables Typedefs Defines