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

applies overdrive distortion. More...

#include <Overdrive.h>

Inheritance diagram for HephAudio::Overdrive:
HephAudio::AudioEffect

Public Member Functions

 Overdrive ()
 
 Overdrive (double drive)
 
virtual ~Overdrive ()=default
 
virtual std::string Name () const override
 
virtual double GetDrive () const
 
virtual void SetDrive (double drive)
 
- 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
 
virtual void ResetInternalState ()
 
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

virtual 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

double drive
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

applies overdrive distortion.

Constructor & Destructor Documentation

◆ Overdrive() [1/2]

HephAudio::Overdrive::Overdrive ( )

creates a new instance and initializes it with default values.

◆ Overdrive() [2/2]

HephAudio::Overdrive::Overdrive ( double drive)
explicit

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

Parameters
drivecontrols the amount of distortion. In the range of [0, 100]

◆ ~Overdrive()

virtual HephAudio::Overdrive::~Overdrive ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

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

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ GetDrive()

virtual double HephAudio::Overdrive::GetDrive ( ) const
virtual

gets the drive.

◆ SetDrive()

virtual void HephAudio::Overdrive::SetDrive ( double drive)
virtual

sets the drive.

Parameters
drivecontrols the amount of distortion. In the range of [0, 100]

◆ ProcessST()

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

Member Data Documentation

◆ drive

double HephAudio::Overdrive::drive
protected

controls the amount of distortion. In the range of [0, 100]