Dynamic Resampling. We can use a variable factor to speed up or slow down the playback.
More...
#include <ResampleStream.h>
|
| ResampleStream (AudioOutput &out) |
|
| ResampleStream (AudioStream &io) |
|
| ResampleStream (Print &out) |
| Support for resampling via write.
|
|
| ResampleStream (Stream &io) |
| Support for resampling via write and read.
|
|
virtual AudioInfo | audioInfo () override |
|
int | available () override |
|
int | availableForWrite () override |
|
virtual bool | begin () |
|
bool | begin (AudioInfo from, int toRate) |
|
bool | begin (AudioInfo info, float step) |
|
bool | begin (ResampleConfig cfg) |
|
ResampleConfig | defaultConfig () |
| Provides the default configuraiton.
|
|
virtual void | end () |
|
void | flush () override |
| When buffering is active, writes the buffered audio to the output.
|
|
virtual Print * | getPrint () |
|
float | getStepSize () |
| Returns the actual step size.
|
|
float | getStepSize (float sampleRateFrom, float sampleRateTo) |
|
virtual Stream * | getStream () |
|
| operator bool () |
|
size_t | readBytes (uint8_t *data, size_t size) override |
|
virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0.
|
|
void | setAudioInfo (AudioInfo info) override |
|
void | setBuffered (bool active) |
| Activates buffering to avoid small incremental writes.
|
|
virtual void | setNotifyAudioChange (AudioInfoSupport &bi) override |
|
void | setStepSize (float step) |
| influence the sample rate
|
|
virtual void | setStream (Print &print) |
|
virtual void | setStream (Stream &stream) |
|
void | setupReader () |
|
virtual bool | validate (AudioInfo &info) |
|
size_t | write (const uint8_t *buffer, size_t bytes) override |
|
virtual size_t | write (uint8_t ch) override |
|
virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0).
|
|
|
template<typename T > |
T | getValue (T *data, float frame_idx, int channel) |
| get the interpolated value for indicated (float) index value
|
|
template<typename T > |
T | lookup (T *data, int frame, int channel) |
|
virtual int | not_supported (int out, const char *msg="") |
|
void | refillReadBuffer () |
|
void | setupLastSamples (AudioInfo cfg) |
| Sets up the buffer for the rollover samples.
|
|
template<typename T > |
void | setupLastSamples (T *data, int frame) |
|
template<typename T > |
size_t | write (Print *p_out, const uint8_t *buffer, size_t bytes, size_t &written) |
| Writes the buffer to p_print after resampling.
|
|
Dynamic Resampling. We can use a variable factor to speed up or slow down the playback.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
- Template Parameters
-
◆ ResampleStream() [1/2]
Support for resampling via write. The audio information is copied from the io
◆ ResampleStream() [2/2]
Support for resampling via write and read. The audio information is copied from the io
◆ getStepSize()
float getStepSize |
( |
float |
sampleRateFrom, |
|
|
float |
sampleRateTo |
|
) |
| |
|
inline |
calculate the step size the sample rate: e.g. from 44200 to 22100 gives a step size of 2 in order to provide fewer samples
The documentation for this class was generated from the following file: