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

SoundGenerator using the ModulationBaseClass to generate the samples. More...

#include <AudioEffectsSuite.h>

Inheritance diagram for SoundGeneratorModulation< T >:
SoundGenerator< T >

Public Member Functions

 SoundGeneratorModulation (ModulationBaseClass &mod, int freq)
 
virtual AudioInfo audioInfo ()
 Provides the AudioInfo.
 
virtual bool begin ()
 
bool begin (AudioInfo info) override
 
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 () override
 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...
 
void setPlayTime (uint32_t playMs, uint8_t upPercent=20, uint8_t downPercent=30)
 

Protected Member Functions

applyRamp (T sample)
 
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)
 
void recalculatePlayTime ()
 

Protected Attributes

bool active
 
bool activeWarningIssued
 
uint32_t currentSample
 
uint8_t downPercent
 
float factor
 
int freq
 
AudioInfo info
 
float max_value =32767
 
ModulationBaseClassp_mod =nullptr
 
uint32_t playMs
 
uint32_t playSamples
 
float rampDownDec
 
uint32_t rampDownSamples
 
float rampUpInc
 
RingBuffer< uint8_t > ring_buffer
 
uint8_t upPercent
 
uint32_t upSamples
 

Detailed Description

template<class T>
class audio_tools::SoundGeneratorModulation< T >

SoundGenerator using the ModulationBaseClass to generate the samples.

Template Parameters
T

Member Function Documentation

◆ begin()

template<class T >
bool begin ( AudioInfo  info)
inlineoverridevirtual

Reimplemented from SoundGenerator< T >.

◆ isActive()

virtual bool isActive ( )
inlinevirtualinherited

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

◆ readSample()

template<class T >
virtual T readSample ( )
inlineoverridevirtual

Provides a single sample.

Implements SoundGenerator< T >.


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