arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Fade Class Reference

Fade In and Fade out in order to prevent popping sound when the audio is started or stopped. The fade in/out is performed over the length of the buffer. More...

#include <Fade.h>

Public Member Functions

void convert (uint8_t *data, int bytes, int channels, int bitsPerSample)
 Updates the amplitude of the data when a fade in or fade out has been requested.
 
bool isFadeComplete ()
 Returns true if the conversion has been executed with any data.
 
bool isFadeInActive ()
 
bool isFadeOutActive ()
 
void setFadeInActive (bool flag)
 
void setFadeOutActive (bool flag)
 

Protected Member Functions

template<typename T >
void convertFrames (T *data, int frames, int channels)
 
template<typename T >
void fadeIn (T *data, int frames, int channels, float delta)
 
template<typename T >
void fadeOut (T *data, int frames, int channels, float delta)
 

Protected Attributes

int channels = 2
 
bool is_done = false
 
bool is_fade_in = false
 
bool is_fade_out = false
 
float volume = 1.0
 

Detailed Description

Fade In and Fade out in order to prevent popping sound when the audio is started or stopped. The fade in/out is performed over the length of the buffer.

Author
Phil Schatzmann

Member Function Documentation

◆ convert()

void convert ( uint8_t data,
int  bytes,
int  channels,
int  bitsPerSample 
)
inline

Updates the amplitude of the data when a fade in or fade out has been requested.

Parameters
data
bytes
channels
bitsPerSample

◆ convertFrames()

template<typename T >
void convertFrames ( T data,
int  frames,
int  channels 
)
inlineprotected

◆ fadeIn()

template<typename T >
void fadeIn ( T data,
int  frames,
int  channels,
float  delta 
)
inlineprotected

◆ fadeOut()

template<typename T >
void fadeOut ( T data,
int  frames,
int  channels,
float  delta 
)
inlineprotected

◆ isFadeComplete()

bool isFadeComplete ( )
inline

Returns true if the conversion has been executed with any data.

◆ isFadeInActive()

bool isFadeInActive ( )
inline

◆ isFadeOutActive()

bool isFadeOutActive ( )
inline

◆ setFadeInActive()

void setFadeInActive ( bool  flag)
inline

◆ setFadeOutActive()

void setFadeOutActive ( bool  flag)
inline

Member Data Documentation

◆ channels

int channels = 2
protected

◆ is_done

bool is_done = false
protected

◆ is_fade_in

bool is_fade_in = false
protected

◆ is_fade_out

bool is_fade_out = false
protected

◆ volume

float volume = 1.0
protected

The documentation for this class was generated from the following file: