arduino-audio-tools
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. More...
 
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

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