TimeStretcher.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     Rubber Band
00005     An audio time-stretching and pitch-shifting library.
00006     Copyright 2007 Chris Cannam.
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 #ifndef _RUBBERBAND_TIMESTRETCHER_H_
00016 #define _RUBBERBAND_TIMESTRETCHER_H_
00017 
00018 #include <sys/types.h>
00019 
00020 namespace RubberBand
00021 {
00022 
00029 class TimeStretcher
00030 {
00031 public:
00032     TimeStretcher(size_t sampleRate, size_t channels) :
00033         m_sampleRate(sampleRate),
00034         m_channels(channels)
00035     { }
00036     virtual ~TimeStretcher()
00037     { }
00038 
00039     virtual void reset() = 0;
00040     virtual void setTimeRatio(double ratio) = 0;
00041     virtual void setPitchScale(double scale) = 0;
00042     virtual size_t getLatency() const = 0;
00043 
00044     virtual void study(const float *const *input, size_t samples, bool final) = 0;
00045     virtual size_t getSamplesRequired() const = 0;
00046     virtual void process(const float *const *input, size_t samples, bool final) = 0;
00047     virtual int available() const = 0;
00048     virtual size_t retrieve(float *const *output, size_t samples) const = 0;
00049 
00050 protected:
00051     size_t m_sampleRate;
00052     size_t m_channels;
00053 };
00054 
00055 }
00056 
00057 #endif
00058     

Generated on Thu Dec 13 21:25:47 2007 for RubberBand by  doxygen 1.5.3