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::PanningEffect Class Referenceabstract

base class for panning effects. More...

#include <PanningEffect.h>

Inheritance diagram for HephAudio::PanningEffect:
HephAudio::AudioEffect HephAudio::LinearPanning HephAudio::SineLawPanning HephAudio::SquareLawPanning

Public Member Functions

virtual ~PanningEffect ()=default
 
virtual void Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override
 
virtual double GetFactor () const =0
 
virtual void SetFactor (double factor)=0
 
virtual void Process (AudioBuffer &buffer)
 
virtual void Process (AudioBuffer &buffer, size_t startIndex)
 
- Public Member Functions inherited from HephAudio::AudioEffect
virtual ~AudioEffect ()=default
 
virtual std::string Name () const =0
 
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

 PanningEffect ()
 
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 leftVolume
 
double rightVolume
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

base class for panning effects.

Constructor & Destructor Documentation

◆ PanningEffect()

HephAudio::PanningEffect::PanningEffect ( )
protected

creates a new instance and initializes it with default values.

◆ ~PanningEffect()

virtual HephAudio::PanningEffect::~PanningEffect ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Process() [1/3]

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

◆ GetFactor()

virtual double HephAudio::PanningEffect::GetFactor ( ) const
pure virtual

gets the panning factor.

Implemented in HephAudio::LinearPanning, HephAudio::SineLawPanning, and HephAudio::SquareLawPanning.

◆ SetFactor()

virtual void HephAudio::PanningEffect::SetFactor ( double factor)
pure virtual

sets the panning factor.

Parameters
factordetermines how the channels' volume will be changed. Ranges between -1 and 1.
-1 means only the left channel will be audible and 1 means only the right channel will be audible.

Implemented in HephAudio::LinearPanning, HephAudio::SineLawPanning, and HephAudio::SquareLawPanning.

◆ ProcessST()

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

◆ leftVolume

double HephAudio::PanningEffect::leftVolume
protected

multiplication factor for the left channel.

◆ rightVolume

double HephAudio::PanningEffect::rightVolume
protected

multiplication factor for the right channel.