HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
base class for the audio effects. More...
#include <AudioEffect.h>
Public Member Functions | |
virtual | ~AudioEffect ()=default |
virtual std::string | Name () const =0 |
virtual bool | HasMTSupport () const |
virtual bool | HasRTSupport () const |
virtual size_t | GetThreadCount () const |
virtual void | SetThreadCount (size_t threadCount) |
virtual size_t | CalculateRequiredFrameCount (size_t outputFrameCount, const AudioFormatInfo &formatInfo) const |
virtual size_t | CalculateOutputFrameCount (const AudioBuffer &buffer) const |
virtual void | Process (AudioBuffer &buffer) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) |
Protected Member Functions | |
AudioEffect () | |
virtual void | ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount)=0 |
virtual void | ProcessMT (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) |
Protected Attributes | |
size_t | threadCount |
base class for the audio effects.
|
protected |
creates a new instance and initializes it with default values.
|
virtualdefault |
releases the resources and destroys the instance.
|
pure virtual |
gets the name of the audio effect.
Implemented in HephAudio::ArctanDistortion, HephAudio::Chorus, HephAudio::CubicDistortion, HephAudio::Echo, HephAudio::Flanger, HephAudio::HardClipDistortion, HephAudio::LinearFadeIn, HephAudio::LinearFadeOut, HephAudio::LinearPanning, HephAudio::Normalizer, HephAudio::Overdrive, HephAudio::RmsNormalizer, HephAudio::SineLawPanning, HephAudio::SquareLawPanning, HephAudio::Tremolo, and HephAudio::Vibrato.
|
virtual |
checks whether the effect can be applied using multiple threads.
|
virtual |
checks whether the effect can be applied in real-time.
|
virtual |
gets the number of threads that will be used.
|
virtual |
sets the number of threads that will be used.
threadCount | number of threads that will be used. |
|
virtual |
calculates the number of frames required to obtain the number of frames desired for the output buffer. Useful for applying effects that depend on past and/or future samples in real-time.
outputFrameCount | the number of frames desired for the output buffer. |
formatInfo | the format info of the input buffer. |
Reimplemented in HephAudio::Chorus, and HephAudio::Vibrato.
|
virtual |
calculates the number of frames the buffer will contain after applying the effect.
buffer | contains the audio data which will be processed. |
|
virtual |
Applies the effect.
buffer | contains the audio data which will be processed. |
Reimplemented in HephAudio::DoubleBufferedAudioEffect, HephAudio::Echo, HephAudio::LinearFadeIn, HephAudio::LinearFadeOut, HephAudio::ModulationEffect, HephAudio::PanningEffect, HephAudio::Tremolo, and HephAudio::Vibrato.
|
virtual |
Applies the effect.
buffer | contains the audio data which will be processed. |
startIndex | index of the first audio frame to process. |
Reimplemented in HephAudio::DoubleBufferedAudioEffect, HephAudio::Echo, HephAudio::LinearFadeIn, HephAudio::LinearFadeOut, HephAudio::ModulationEffect, HephAudio::PanningEffect, HephAudio::Tremolo, and HephAudio::Vibrato.
|
virtual |
Applies the effect.
buffer | contains the audio data which will be processed. |
startIndex | index of the first audio frame to process. |
frameCount | number of frames to process. |
Reimplemented in HephAudio::DoubleBufferedAudioEffect, HephAudio::Echo, HephAudio::Flanger, HephAudio::LinearFadeIn, HephAudio::LinearFadeOut, HephAudio::ModulationEffect, HephAudio::PanningEffect, HephAudio::Tremolo, and HephAudio::Vibrato.
|
protectedpure virtual |
applies the effect using single thread.
inputBuffer | contains the dry data. |
outputBuffer | contains the wet data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Implemented in HephAudio::ArctanDistortion, HephAudio::Chorus, HephAudio::CubicDistortion, HephAudio::Echo, HephAudio::Flanger, HephAudio::HardClipDistortion, HephAudio::LinearFadeIn, HephAudio::LinearFadeOut, HephAudio::Normalizer, HephAudio::Overdrive, HephAudio::PanningEffect, HephAudio::RmsNormalizer, HephAudio::Tremolo, and HephAudio::Vibrato.
|
protectedvirtual |
applies the effect using multiple threads.
inputBuffer | contains the dry data. |
outputBuffer | contains the wet data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
|
protected |
number of threads that will be used.