HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::DoubleBufferedAudioEffect Class Reference

base class for audio effects that use a temporary buffer while processing. More...

#include <DoubleBufferedAudioEffect.h>

Inheritance diagram for HephAudio::DoubleBufferedAudioEffect:
HephAudio::AudioEffect HephAudio::ChannelMapper HephAudio::ModulationEffect HephAudio::OlaEffect HephAudio::Resampler HephAudio::Flanger HephAudio::Tremolo HephAudio::Vibrato HephAudio::FrequencyDomainEffect HephAudio::PitchShifter HephAudio::TimeStretcher HephAudio::Chorus HephAudio::Equalizer HephAudio::Spatializer HephAudio::BandCutFilter HephAudio::BandPassFilter HephAudio::HighPassFilter HephAudio::LowPassFilter

Public Member Functions

virtual ~DoubleBufferedAudioEffect ()=default
 
virtual void Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override
 
virtual void Process (AudioBuffer &buffer)
 
virtual void Process (AudioBuffer &buffer, size_t startIndex)
 
- Public Member Functions inherited from HephAudio::AudioEffect
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 (size_t inputFrameCount, const AudioFormatInfo &formatInfo) const
 
virtual size_t CalculateAdvanceSize (size_t renderFrameCount, const AudioFormatInfo &formatInfo) const
 
virtual void ResetInternalState ()
 

Protected Member Functions

 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 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)
 

Additional Inherited Members

- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

base class for audio effects that use a temporary buffer while processing.

Constructor & Destructor Documentation

◆ DoubleBufferedAudioEffect()

HephAudio::DoubleBufferedAudioEffect::DoubleBufferedAudioEffect ( )
protected

creates a new instance and initializes it with default values.

◆ ~DoubleBufferedAudioEffect()

virtual HephAudio::DoubleBufferedAudioEffect::~DoubleBufferedAudioEffect ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Process() [1/3]

virtual void HephAudio::DoubleBufferedAudioEffect::Process ( AudioBuffer & buffer,
size_t startIndex,
size_t frameCount )
overridevirtual

Applies the effect.

Parameters
buffercontains the audio data which will be processed.
startIndexindex of the first audio frame to process.
frameCountnumber of frames to process.

Reimplemented from HephAudio::AudioEffect.

Reimplemented in HephAudio::Flanger, HephAudio::ModulationEffect, HephAudio::OlaEffect, HephAudio::Spatializer, HephAudio::Tremolo, and HephAudio::Vibrato.

◆ CreateOutputBuffer()

virtual AudioBuffer HephAudio::DoubleBufferedAudioEffect::CreateOutputBuffer ( const AudioBuffer & inputBuffer,
size_t startIndex,
size_t frameCount ) const
protectedvirtual

creates the output buffer but does not initialize it.

Parameters
inputBuffercontains the audio data which will be processed.
startIndexindex of the first sample to process.
frameCountnumber of frames to process.

Reimplemented in HephAudio::ChannelMapper, and HephAudio::Resampler.

◆ InitializeOutputBuffer()

virtual void HephAudio::DoubleBufferedAudioEffect::InitializeOutputBuffer ( const AudioBuffer & inputBuffer,
AudioBuffer & outputBuffer,
size_t startIndex,
size_t frameCount ) const
protectedvirtual

initializes the output buffer.

Parameters
inputBuffercontains the audio data which will be processed.
outputBuffercontains the processed audio data.
startIndexindex of the first sample to process.
frameCountnumber of frames to process.

Reimplemented in HephAudio::ChannelMapper, and HephAudio::Resampler.

◆ Process() [2/3]

virtual void HephAudio::AudioEffect::Process ( AudioBuffer & buffer)
virtual

Applies the effect.

Parameters
buffercontains the audio data which will be processed.

Reimplemented from HephAudio::AudioEffect.

Reimplemented in HephAudio::ModulationEffect, HephAudio::OlaEffect, HephAudio::Tremolo, and HephAudio::Vibrato.

◆ Process() [3/3]

virtual void HephAudio::AudioEffect::Process ( AudioBuffer & buffer,
size_t startIndex )
virtual

Applies the effect.

Parameters
buffercontains the audio data which will be processed.
startIndexindex of the first audio frame to process.

Reimplemented from HephAudio::AudioEffect.

Reimplemented in HephAudio::ModulationEffect, HephAudio::OlaEffect, HephAudio::Tremolo, and HephAudio::Vibrato.