svcore  1.9
Resampler.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     
00008     This program is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU General Public License as
00010     published by the Free Software Foundation; either version 2 of the
00011     License, or (at your option) any later version.  See the file
00012     COPYING included with this distribution for more information.
00013 */
00014 
00015 /*
00016    This is a modified version of a source file from the 
00017    Rubber Band audio timestretcher library.
00018    This file copyright 2007 Chris Cannam.
00019 */
00020 
00021 #ifndef _RESAMPLER_H_
00022 #define _RESAMPLER_H_
00023 
00024 #include <sys/types.h>
00025 
00026 class Resampler
00027 {
00028 public:
00029     enum Quality { Best, FastestTolerable, Fastest };
00030 
00031     Resampler(Quality quality, int channels, int chunkSize = 0);
00032     ~Resampler();
00033 
00034     int resample(float **in, float **out,
00035                     int incount, float ratio,
00036                     bool final = false);
00037 
00038     int resampleInterleaved(float *in, float *out,
00039                                int incount, float ratio,
00040                                bool final = false);
00041 
00042     void reset();
00043 
00044 protected:
00045     class D;
00046     D *m_d;
00047 };
00048 
00049 #endif