HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
changes the playback speed of the audio data without changing the pitch. More...
#include <TimeStretcher.h>
Public Member Functions | |
TimeStretcher () | |
TimeStretcher (double speed) | |
TimeStretcher (double speed, size_t hopSize) | |
TimeStretcher (double speed, size_t hopSize, const Window &wnd) | |
virtual | ~TimeStretcher ()=default |
virtual std::string | Name () const override |
virtual bool | HasRTSupport () const override |
virtual size_t | CalculateRequiredFrameCount (size_t outputFrameCount, const AudioFormatInfo &formatInfo) const override |
virtual size_t | CalculateOutputFrameCount (size_t inputFrameCount, const AudioFormatInfo &formatInfo) const override |
virtual double | GetSpeed () const |
virtual void | SetSpeed (double speed) |
Public Member Functions inherited from HephAudio::OlaEffect | |
virtual | ~OlaEffect ()=default |
virtual void | ResetInternalState () override |
virtual void | Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override |
virtual size_t | GetHopSize () const |
virtual void | SetHopSize (size_t hopSize) |
virtual size_t | GetWindowSize () const |
virtual void | SetWindow (const Window &wnd) |
virtual void | Process (AudioBuffer &buffer) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex) |
Public Member Functions inherited from HephAudio::DoubleBufferedAudioEffect | |
virtual | ~DoubleBufferedAudioEffect ()=default |
Public Member Functions inherited from HephAudio::AudioEffect | |
virtual | ~AudioEffect ()=default |
virtual bool | HasMTSupport () const |
virtual size_t | GetThreadCount () const |
virtual void | SetThreadCount (size_t threadCount) |
virtual size_t | CalculateAdvanceSize (size_t renderFrameCount, const AudioFormatInfo &formatInfo) const |
Protected Member Functions | |
virtual void | ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override |
Protected Member Functions inherited from HephAudio::OlaEffect | |
OlaEffect () | |
OlaEffect (size_t hopSize) | |
OlaEffect (size_t hopSize, const Window &wnd) | |
virtual size_t | CalculateMaxNumberOfOverlaps () const |
virtual size_t | CalculatePastSamplesSize () const |
Protected Member Functions inherited from HephAudio::DoubleBufferedAudioEffect | |
DoubleBufferedAudioEffect () | |
virtual AudioBuffer | CreateOutputBuffer (const AudioBuffer &inputBuffer, size_t startIndex, size_t frameCount) const |
virtual void | InitializeOutputBuffer (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) const |
Protected Member Functions inherited from HephAudio::AudioEffect | |
AudioEffect () | |
virtual void | ProcessMT (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) |
Protected Attributes | |
double | speed |
Protected Attributes inherited from HephAudio::OlaEffect | |
size_t | hopSize |
Heph::DoubleBuffer | wnd |
size_t | currentIndex |
AudioBuffer | pastSamples |
Protected Attributes inherited from HephAudio::AudioEffect | |
size_t | threadCount |
changes the playback speed of the audio data without changing the pitch.
HephAudio::TimeStretcher::TimeStretcher | ( | ) |
creates a new instance and initializes it with default values.
|
explicit |
creates a new instance and initializes it with the provided values.
speed | playback speed factor. |
HephAudio::TimeStretcher::TimeStretcher | ( | double | speed, |
size_t | hopSize ) |
creates a new instance and initializes it with the provided values.
speed | playback speed factor. |
hopSize | number of frames to advance each iteration. |
HephAudio::TimeStretcher::TimeStretcher | ( | double | speed, |
size_t | hopSize, | ||
const Window & | wnd ) |
creates a new instance and initializes it with the provided values.
speed | playback speed factor. |
hopSize | number of frames to advance each iteration. |
wnd | window that will be applied for overlap-add. |
|
virtualdefault |
releases the resources and destroys the instance.
|
overridevirtual |
gets the name of the audio effect.
Implements HephAudio::AudioEffect.
|
overridevirtual |
checks whether the effect can be applied in real-time.
Reimplemented from HephAudio::AudioEffect.
|
overridevirtual |
calculates the number of frames required to obtain the number of frames desired for the output buffer.
outputFrameCount | the number of frames desired for the output buffer. |
formatInfo | the format info of the input buffer. |
Reimplemented from HephAudio::OlaEffect.
|
overridevirtual |
calculates the number of frames the buffer will contain after applying the effect.
inputFrameCount | the number of frames of the input buffer. |
formatInfo | the format info of the input buffer. |
Reimplemented from HephAudio::AudioEffect.
|
virtual |
gets the speed factor.
|
virtual |
sets the speed factor.
speed | playback speed factor. |
|
overrideprotectedvirtual |
applies the effect using single thread.
inputBuffer | contains the audio data which will be processed. |
outputBuffer | contains the processed audio data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Implements HephAudio::AudioEffect.
|
protected |
playback speed factor.