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

applies hard-clipping distortion. More...

#include <HardClipDistortion.h>

Inheritance diagram for HephAudio::HardClipDistortion:
HephAudio::AudioEffect

Public Member Functions

 HardClipDistortion ()
 
 HardClipDistortion (double clippingLevel)
 
virtual ~HardClipDistortion ()=default
 
virtual std::string Name () const override
 
virtual double GetClippingLevel () const
 
virtual void SetClippingLevel (double clippingLevel)
 
- 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

heph_audio_sample_t clippingLevel
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

applies hard-clipping distortion.

Constructor & Destructor Documentation

◆ HardClipDistortion() [1/2]

HephAudio::HardClipDistortion::HardClipDistortion ( )

creates a new instance and initializes it with default values.

◆ HardClipDistortion() [2/2]

HephAudio::HardClipDistortion::HardClipDistortion ( double clippingLevel)
explicit

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

Parameters
clippingLevelthreshold value in decibels.

◆ ~HardClipDistortion()

virtual HephAudio::HardClipDistortion::~HardClipDistortion ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

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

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ GetClippingLevel()

virtual double HephAudio::HardClipDistortion::GetClippingLevel ( ) const
virtual

gets the clipping level in decibels.

◆ SetClippingLevel()

virtual void HephAudio::HardClipDistortion::SetClippingLevel ( double clippingLevel)
virtual

sets the clipping level.

Parameters
clippingLevelthreshold value in decibels.

◆ ProcessST()

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

◆ clippingLevel

heph_audio_sample_t HephAudio::HardClipDistortion::clippingLevel
protected

threshold value.