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::Tremolo Class Reference

changes the volume of the audio data periodically and mixes the result with the input signal. More...

#include <Tremolo.h>

Inheritance diagram for HephAudio::Tremolo:
HephAudio::ModulationEffect HephAudio::DoubleBufferedAudioEffect HephAudio::AudioEffect

Public Member Functions

 Tremolo ()
 
 Tremolo (double depth, const Oscillator &lfo)
 
virtual ~Tremolo ()=default
 
virtual std::string Name () const override
 
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::ModulationEffect
virtual ~ModulationEffect ()=default
 
virtual void ResetInternalState () override
 
virtual void SetOscillator (const Oscillator &lfo)
 
virtual double GetDepth () const
 
virtual void SetDepth (double depth)
 
- 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 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
 

Protected Member Functions

virtual void ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override
 
- Protected Member Functions inherited from HephAudio::ModulationEffect
 ModulationEffect ()
 
 ModulationEffect (double depth, const Oscillator &lfo)
 
- 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)
 

Additional Inherited Members

- Protected Attributes inherited from HephAudio::ModulationEffect
Heph::DoubleBuffer lfoBuffer
 
double depth
 
size_t lfoIndex
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

changes the volume of the audio data periodically and mixes the result with the input signal.

Constructor & Destructor Documentation

◆ Tremolo() [1/2]

HephAudio::Tremolo::Tremolo ( )

creates a new instance and initializes it with default values.

◆ Tremolo() [2/2]

HephAudio::Tremolo::Tremolo ( double depth,
const Oscillator & lfo )

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

Parameters
depthcontrols the dry/wet mix ratio. Ranges between 0 and 1.
lfolow-frequency oscillator.

◆ ~Tremolo()

virtual HephAudio::Tremolo::~Tremolo ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

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

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ Process() [1/3]

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

◆ ProcessST()

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

applies the effect using single thread.

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.

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::ModulationEffect.

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