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

applies linear fade-in. More...

#include <LinearFadeIn.h>

Inheritance diagram for HephAudio::LinearFadeIn:
HephAudio::AudioEffect

Public Member Functions

 LinearFadeIn ()
 
 LinearFadeIn (double duration)
 
 LinearFadeIn (double duration, size_t startIndex)
 
virtual ~LinearFadeIn ()=default
 
virtual std::string Name () const override
 
virtual void Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override
 
virtual double GetDuration () const
 
virtual void SetDuration (double duration)
 
virtual size_t GetStartIndex () const
 
virtual void SetStartIndex (size_t startIndex)
 
virtual void Process (AudioBuffer &buffer)
 
virtual void Process (AudioBuffer &buffer, size_t startIndex)
 
- 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
 

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 duration
 
size_t startIndex
 
size_t currentIndex
 
- Protected Attributes inherited from HephAudio::AudioEffect
size_t threadCount
 

Detailed Description

applies linear fade-in.

Constructor & Destructor Documentation

◆ LinearFadeIn() [1/3]

HephAudio::LinearFadeIn::LinearFadeIn ( )

creates a new instance and initializes it with default values.

◆ LinearFadeIn() [2/3]

HephAudio::LinearFadeIn::LinearFadeIn ( double duration)
explicit

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

Parameters
durationduration of the fade-in in seconds.

◆ LinearFadeIn() [3/3]

HephAudio::LinearFadeIn::LinearFadeIn ( double duration,
size_t startIndex )

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

Parameters
durationduration of the fade-in in seconds.
startIndexindex of the first audio frame the effect will be applied to.

◆ ~LinearFadeIn()

virtual HephAudio::LinearFadeIn::~LinearFadeIn ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Name()

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

gets the name of the audio effect.

Implements HephAudio::AudioEffect.

◆ Process() [1/3]

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

◆ GetDuration()

virtual double HephAudio::LinearFadeIn::GetDuration ( ) const
virtual

gets the duration in seconds.

◆ SetDuration()

virtual void HephAudio::LinearFadeIn::SetDuration ( double duration)
virtual

sets the duration.

Parameters
durationduration of the fade-in in seconds.

◆ GetStartIndex()

virtual size_t HephAudio::LinearFadeIn::GetStartIndex ( ) const
virtual

gets the start index.

◆ SetStartIndex()

virtual void HephAudio::LinearFadeIn::SetStartIndex ( size_t startIndex)
virtual

sets the start index.

Parameters
startIndexindex of the first audio frame the effect will be applied to.

◆ ProcessST()

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

◆ duration

double HephAudio::LinearFadeIn::duration
protected

duration of the fade-in in seconds.

◆ startIndex

size_t HephAudio::LinearFadeIn::startIndex
protected

index of the first audio frame the effect will be applied to.

◆ currentIndex

size_t HephAudio::LinearFadeIn::currentIndex
protected

for real-time processing.