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

EffectsStreamT: the template class describes an input or output stream to which one or multiple effects are applied. The number of channels are used to merge the samples of one frame into one sample before outputting the result as a frame (by repeating the result sample for each channel). Currently only int16_t values are supported, so I recommend to use the AudioEffectStream class which is defined as using AudioEffectStream = AudioEffectStreamT<effect_t>;. More...

#include <AudioEffects.h>

Inheritance diagram for AudioEffectStreamT< T >:
AudioStreamX AudioStream Stream AudioBaseInfoDependent AudioBaseInfoSource Print

Public Member Functions

 AudioEffectStreamT (Print &out)
 
 AudioEffectStreamT (Stream &io)
 
void addEffect (AudioEffect &effect)
 Adds an effect object (by reference)
 
void addEffect (AudioEffect *effect)
 Adds an effect using a pointer.
 
int available () override
 
int availableForWrite () override
 
bool begin (AudioBaseInfo cfg)
 
void clear ()
 deletes all defined effects
 
AudioBaseInfo defaultConfig ()
 
void end () override
 
AudioEffectfindEffect (int id)
 Finds an effect by id.
 
AudioEffectoperator[] (int idx)
 gets an effect by index
 
size_t readBytes (uint8_t *buffer, size_t length) override
 
void setInput (Stream &io)
 
void setOutput (Print &print)
 
void setOutput (Stream &io)
 
size_t size ()
 Provides the actual number of defined effects.
 
size_t write (const uint8_t *buffer, size_t length) override
 
- Public Member Functions inherited from AudioStreamX
 AudioStreamX (AudioStreamX const &)=delete
 
AudioStreamXoperator= (AudioStreamX const &)=delete
 
virtual int peek () override
 
virtual int read () override
 
virtual size_t write (uint8_t) override
 
- Public Member Functions inherited from AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual bool begin ()
 
virtual void flush () override
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual StreamtoStreamPointer ()
 
virtual void writeSilence (size_t len)
 
- Public Member Functions inherited from Stream
virtual void setTimeout (size_t t)
 
- Public Member Functions inherited from Print
virtual int print (char c, PrintCharFmt spec)
 
virtual int print (const char *msg)
 
virtual int print (int number)
 
virtual int println (const char *msg="")
 
virtual size_t write (const char *buffer, size_t size)
 
virtual size_t write (const char *str)
 
- Public Member Functions inherited from AudioBaseInfoDependent
virtual bool validate (AudioBaseInfo &info)
 

Protected Attributes

bool active = false
 
AudioEffectCommon effects
 
Streamp_io =nullptr
 
Printp_print =nullptr
 
- Protected Attributes inherited from AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from AudioStream
virtual int not_supported (int out)
 

Detailed Description

template<class T>
class audio_tools::AudioEffectStreamT< T >

EffectsStreamT: the template class describes an input or output stream to which one or multiple effects are applied. The number of channels are used to merge the samples of one frame into one sample before outputting the result as a frame (by repeating the result sample for each channel). Currently only int16_t values are supported, so I recommend to use the AudioEffectStream class which is defined as using AudioEffectStream = AudioEffectStreamT<effect_t>;.

Author
Phil Schatzmann

Member Function Documentation

◆ readBytes()

size_t readBytes ( uint8_t *  buffer,
size_t  length 
)
inlineoverridevirtual

Provides the audio data by reading the assinged Stream and applying the effects on that input

Reimplemented from AudioStreamX.

◆ write()

size_t write ( const uint8_t *  buffer,
size_t  length 
)
inlineoverridevirtual

Writes the samples passed in the buffer and applies the effects before writing the result to the output defined in the constructor.

Reimplemented from AudioStreamX.


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