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

adds echo to the audio data. More...

#include <Echo.h>

Inheritance diagram for HephAudio::Echo:
HephAudio::AudioEffect

Public Member Functions

 Echo ()
 
 Echo (size_t reflectionCount, double reflectionDelay, double decayFactor, double echoStart, double echoDuration)
 
virtual ~Echo ()=default
 
virtual std::string Name () const override
 
virtual void Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override
 
virtual size_t GetReflectionCount () const
 
virtual void SetReflectionCount (size_t reflectionCount)
 
virtual double GetReflectionDelay () const
 
virtual void SetReflectionDelay (double reflectionDelay)
 
virtual double GetDecayFactor () const
 
virtual void SetDecayFactor (double decayFactor)
 
virtual double GetEchoStart () const
 
virtual void SetEchoStart (double echoStart)
 
virtual double GetEchoDuration () const
 
virtual void SetEchoDuration (double echoDuration)
 
virtual void Process (AudioBuffer &buffer)
 
virtual void Process (AudioBuffer &buffer, size_t startIndex)
 
- Public Member Functions inherited from HephAudio::AudioEffect
virtual ~AudioEffect ()=default
 
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
 

Protected Member Functions

void ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override
 
- Protected Member Functions inherited from HephAudio::AudioEffect
 AudioEffect ()
 
virtual void ProcessMT (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount)
 

Protected Attributes

size_t reflectionCount
 
double reflectionDelay
 
double decayFactor
 
double echoStart
 
double echoDuration
 
AudioBuffer pastSamples
 
size_t currentIndex
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

adds echo to the audio data.

Constructor & Destructor Documentation

◆ Echo() [1/2]

HephAudio::Echo::Echo ( )

creates a new instance and initializes it with default values.

◆ Echo() [2/2]

HephAudio::Echo::Echo ( size_t reflectionCount,
double reflectionDelay,
double decayFactor,
double echoStart,
double echoDuration )

creates a new instance and initializes it with the provided values.

Parameters
reflectionCountnumber of times the audio data will be reflected.
reflectionDelayelapsed time, in seconds, between the start of each reflection.
decayFactorthe factor which echo data will be multiplied by between each reflection.
echoStartstart time, in seconds, of the audio data that will be used as echo.
echoDurationduration of the audio data, in seconds, that will be used as echo.

◆ ~Echo()

virtual HephAudio::Echo::~Echo ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

virtual std::string HephAudio::Echo::Name ( ) const
overridevirtual

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ Process() [1/3]

virtual void HephAudio::Echo::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.

◆ GetReflectionCount()

virtual size_t HephAudio::Echo::GetReflectionCount ( ) const
virtual

gets the reflection count.

◆ SetReflectionCount()

virtual void HephAudio::Echo::SetReflectionCount ( size_t reflectionCount)
virtual

sets the reflection count.

Parameters
reflectionCountnumber of times the audio data will be reflected.

◆ GetReflectionDelay()

virtual double HephAudio::Echo::GetReflectionDelay ( ) const
virtual

gets the reflection delay.

◆ SetReflectionDelay()

virtual void HephAudio::Echo::SetReflectionDelay ( double reflectionDelay)
virtual

sets the reflection delay.

Parameters
reflectionDelayelapsed time, in seconds, between the start of each reflection.

◆ GetDecayFactor()

virtual double HephAudio::Echo::GetDecayFactor ( ) const
virtual

gets the decay factor.

◆ SetDecayFactor()

virtual void HephAudio::Echo::SetDecayFactor ( double decayFactor)
virtual

sets the decay factor.

Parameters
decayFactorthe factor which echo data will be multiplied by between each reflection.

◆ GetEchoStart()

virtual double HephAudio::Echo::GetEchoStart ( ) const
virtual

gets the echo start.

◆ SetEchoStart()

virtual void HephAudio::Echo::SetEchoStart ( double echoStart)
virtual

sets the echo start.

Parameters
echoStartstart time, in seconds, of the audio data that will be used as echo.

◆ GetEchoDuration()

virtual double HephAudio::Echo::GetEchoDuration ( ) const
virtual

gets the echo duration.

◆ SetEchoDuration()

virtual void HephAudio::Echo::SetEchoDuration ( double echoDuration)
virtual

sets the echo duration.

Parameters
echoDurationduration of the audio data, in seconds, that will be used as echo.

◆ ProcessST()

void HephAudio::Echo::ProcessST ( const AudioBuffer & inputBuffer,
AudioBuffer & outputBuffer,
size_t startIndex,
size_t frameCount )
overrideprotectedvirtual

applies the effect using single thread.

Parameters
inputBuffercontains the dry data.
outputBuffercontains the wet data.
startIndexindex of the first sample to process.
frameCountnumber of frames to process.

Implements HephAudio::AudioEffect.

◆ 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.

◆ 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.

Member Data Documentation

◆ reflectionCount

size_t HephAudio::Echo::reflectionCount
protected

number of times the audio data will be reflected.

◆ reflectionDelay

double HephAudio::Echo::reflectionDelay
protected

elapsed time, in seconds, between the start of each reflection.

◆ decayFactor

double HephAudio::Echo::decayFactor
protected

the factor which echo data will be multiplied by between each reflection.

◆ echoStart

double HephAudio::Echo::echoStart
protected

start time, in seconds, of the audio data that will be used as echo.

◆ echoDuration

double HephAudio::Echo::echoDuration
protected

duration of the audio data, in seconds, that will be used as echo.

◆ pastSamples

AudioBuffer HephAudio::Echo::pastSamples
protected

past samples required for real-time processing.

◆ currentIndex

size_t HephAudio::Echo::currentIndex
protected

for real-time processing.