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

applies soft-clipping distortion via arctan function. More...

#include <ArctanDistortion.h>

Inheritance diagram for HephAudio::ArctanDistortion:
HephAudio::AudioEffect

Public Member Functions

 ArctanDistortion ()
 
 ArctanDistortion (double factor)
 
virtual ~ArctanDistortion ()=default
 
virtual std::string Name () const override
 
virtual double GetFactor () const
 
virtual void SetFactor (double factor)
 
- 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
 
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 factor
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

applies soft-clipping distortion via arctan function.

Constructor & Destructor Documentation

◆ ArctanDistortion() [1/2]

HephAudio::ArctanDistortion::ArctanDistortion ( )

creates a new instance and initializes it with default values.

◆ ArctanDistortion() [2/2]

HephAudio::ArctanDistortion::ArctanDistortion ( double factor)
explicit

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

Parameters
factorcontrols the amount of distortion. Must be non-negative.

◆ ~ArctanDistortion()

virtual HephAudio::ArctanDistortion::~ArctanDistortion ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

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

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ GetFactor()

virtual double HephAudio::ArctanDistortion::GetFactor ( ) const
virtual

gets the factor.

◆ SetFactor()

virtual void HephAudio::ArctanDistortion::SetFactor ( double factor)
virtual

sets the facotr.

Parameters
factorcontrols the amount of distortion. Must be non-negative.

◆ ProcessST()

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

Member Data Documentation

◆ factor

double HephAudio::ArctanDistortion::factor
protected

controls the amount of distortion. Must be non-negative.