arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::AudioEffects< GeneratorT > Class Template Reference

AudioEffects: the template class describes the input audio to which the effects are applied: e.g. SineWaveGenerator, SquareWaveGenerator, GeneratorFromStream etc. We support only one channel of int16_t data! More...

#include <AudioEffects.h>

Inheritance diagram for audio_tools::AudioEffects< GeneratorT >:
audio_tools::SoundGenerator< effect_t >

Public Member Functions

 AudioEffects ()=default
 Default constructor.
 
 AudioEffects (AudioEffects &copy)
 Copy constructor.
 
 AudioEffects (GeneratorT &generator)
 Constructor which is assigning a generator.
 
 AudioEffects (Stream &input, int channels=2, float volume=1.0)
 
virtual ~AudioEffects ()
 Destructor.
 
void addEffect (AudioEffect &effect)
 Adds an effect object (by reference)
 
void addEffect (AudioEffect *effect)
 Adds an effect using a pointer.
 
void clear ()
 deletes all defined effects
 
AudioEffectfindEffect (int id)
 Finds an effect by id.
 
GeneratorT & generator ()
 Provides access to the sound generator.
 
AudioEffectoperator[] (int idx)
 gets an effect by index
 
effect_t readSample () override
 provides the resulting sample More...
 
void setInput (GeneratorT &in)
 Defines the input source for the raw guitar input.
 
size_t size ()
 Provides the actual number of defined effects.
 
- Public Member Functions inherited from audio_tools::SoundGenerator< effect_t >
virtual AudioBaseInfo audioInfo ()
 
virtual bool begin ()
 
virtual bool begin (AudioBaseInfo info)
 
virtual AudioBaseInfo defaultConfig ()
 
virtual void end ()
 ends the processing
 
virtual bool isActive ()
 Checks if the begin method has been called - after end() isActive returns false.
 
virtual size_t readBytes (uint8_t *buffer, size_t lengthBytes)
 Provides the data as byte array with the requested number of channels.
 
virtual effect_t readSample ()=0
 Provides a single sample. More...
 
virtual size_t readSamples (effect_t *data, size_t sampleCount=512)
 Provides the samples into simple array - which represents 1 channel.
 
virtual size_t readSamples (effect_t src[][2], size_t frameCount)
 Provides the samples into a 2 channel array.
 
virtual void setAudioInfo (AudioBaseInfo info)
 
virtual void setFrequency (uint16_t frequency)
 

Protected Attributes

Vector< AudioEffect * > effects
 
bool owns_generator = false
 
GeneratorT * p_generator =nullptr
 
- Protected Attributes inherited from audio_tools::SoundGenerator< effect_t >
bool active
 
bool activeWarningIssued
 
AudioBaseInfo info
 
int output_channels
 

Detailed Description

template<class GeneratorT>
class audio_tools::AudioEffects< GeneratorT >

AudioEffects: the template class describes the input audio to which the effects are applied: e.g. SineWaveGenerator, SquareWaveGenerator, GeneratorFromStream etc. We support only one channel of int16_t data!

We subclass the AudioEffects from GeneratorT so that we can use this class with the GeneratedSoundStream class to output the audio.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ AudioEffects()

template<class GeneratorT >
audio_tools::AudioEffects< GeneratorT >::AudioEffects ( Stream input,
int  channels = 2,
float  volume = 1.0 
)
inline

Constructor which is assigning a Stream as input. The stream must consist of int16_t values with the indicated number of channels. Type type parameter is e.g. <GeneratorFromStream<effect_t>

Member Function Documentation

◆ readSample()

template<class GeneratorT >
effect_t audio_tools::AudioEffects< GeneratorT >::readSample ( )
inlineoverridevirtual

provides the resulting sample

Implements audio_tools::SoundGenerator< effect_t >.


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