arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioEffects< GeneratorT > Class Template Reference

OBSOLETE 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 AudioEffects< GeneratorT >:
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.
 
virtual AudioInfo audioInfo ()
 Provides the AudioInfo.
 
virtual bool begin ()
 
virtual bool begin (AudioInfo info)
 
void clear ()
 deletes all defined effects
 
virtual AudioInfo defaultConfig ()
 Provides the default configuration.
 
virtual void end ()
 ends the processing
 
AudioEffectfindEffect (int id)
 Finds an effect by id.
 
GeneratorT & generator ()
 Provides access to the sound generator.
 
virtual bool isActive ()
 
AudioEffectoperator[] (int idx)
 gets an effect by index
 
virtual size_t readBytes (uint8_t *buffer, size_t lengthBytes)
 Provides the data as byte array with the requested number of channels.
 
effect_t readSample () override
 provides the resulting sample
 
virtual void setAudioInfo (AudioInfo info)
 Defines/updates the AudioInfo.
 
virtual void setFrequency (float frequency)
 Abstract method: not implemented! Just provides an error message...
 
void setInput (GeneratorT &in)
 Defines the input source for the raw guitar input.
 
size_t size ()
 Provides the actual number of defined effects.
 

Protected Member Functions

size_t readBytesFrames (uint8_t *buffer, size_t lengthBytes, int frames, int channels)
 
size_t readBytesFromBuffer (uint8_t *buffer, size_t lengthBytes, int frame_size, int channels)
 

Protected Attributes

bool active
 
bool activeWarningIssued
 
AudioEffectCommon effects
 
AudioInfo info
 
bool owns_generator = false
 
GeneratorT * p_generator =nullptr
 
RingBuffer< uint8_t > ring_buffer
 

Detailed Description

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

OBSOLETE 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()

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

◆ isActive()

virtual bool isActive ( )
inlinevirtualinherited

Checks if the begin method has been called - after end() isActive returns false


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