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

Base class to define the abstract interface for the sound generating classes. More...

#include <SoundGenerator.h>

Inheritance diagram for SoundGenerator< T >:
GeneratorFixedValue< T > GeneratorFromArray< T > GeneratorFromStream< T > GeneratorMixer< T > PinkNoiseGenerator< T > STKGenerator< StkCls, T > SilenceGenerator< T > SineFromTable< T > SineWaveGenerator< T > SoundGeneratorModulation< T > TestGenerator< T > WhiteNoiseGenerator< T >

Public Member Functions

virtual AudioInfo audioInfo ()
 Provides the AudioInfo.
 
virtual bool begin ()
 
virtual bool begin (AudioInfo info)
 
virtual AudioInfo defaultConfig ()
 Provides the default configuration.
 
virtual void end ()
 ends the processing
 
virtual bool isActive ()
 
virtual size_t readBytes (uint8_t *data, size_t len)
 Provides the data as byte array with the requested number of channels.
 
virtual T readSample ()=0
 Provides a single sample.
 
virtual void setAudioInfo (AudioInfo info)
 Defines/updates the AudioInfo.
 
virtual void setFrequency (float frequency)
 Abstract method: not implemented! Just provides an error message...
 

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 = false
 
bool activeWarningIssued = false
 
AudioInfo info
 
RingBuffer< uint8_t > ring_buffer {0}
 

Detailed Description

template<class T>
class audio_tools::SoundGenerator< T >

Base class to define the abstract interface for the sound generating classes.

Author
Phil Schatzmann
Template Parameters
T

Member Function Documentation

◆ isActive()

virtual bool isActive ( )
inlinevirtual

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


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