1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
5 An audio time-stretching and pitch-shifting library.
6 Copyright 2007 Chris Cannam.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
15 #ifndef _RUBBERBAND_TIMESTRETCHER_H_
16 #define _RUBBERBAND_TIMESTRETCHER_H_
18 #include <sys/types.h>
24 * Base class for time stretchers. RubberBand currently provides only
25 * a single subclass implementation.
27 * @see RubberBandStretcher
32 TimeStretcher(size_t sampleRate
, size_t channels
) :
33 m_sampleRate(sampleRate
),
36 virtual ~TimeStretcher()
39 virtual void reset() = 0;
40 virtual void setTimeRatio(double ratio
) = 0;
41 virtual void setPitchScale(double scale
) = 0;
42 virtual size_t getLatency() const = 0;
44 virtual void study(const float *const *input
, size_t samples
, bool final
) = 0;
45 virtual size_t getSamplesRequired() const = 0;
46 virtual void process(const float *const *input
, size_t samples
, bool final
) = 0;
47 virtual int available() const = 0;
48 virtual size_t retrieve(float *const *output
, size_t samples
) const = 0;