Base class to define the abstract interface for the sound generating classes.
More...
#include <SoundGenerator.h>
template<class T = int16_t>
class audio_tools::SoundGenerator< T >
Base class to define the abstract interface for the sound generating classes.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
- Template Parameters
-
◆ SoundGenerator()
template<class T = int16_t>
◆ ~SoundGenerator()
template<class T = int16_t>
◆ applyRamp()
template<class T = int16_t>
◆ audioInfo()
template<class T = int16_t>
◆ begin() [1/2]
template<class T = int16_t>
◆ begin() [2/2]
template<class T = int16_t>
Starts the processing with the provided AudioInfo.
◆ defaultConfig()
template<class T = int16_t>
Provides the default configuration.
◆ end() [1/2]
template<class T = int16_t>
◆ end() [2/2]
template<class T = int16_t>
| virtual void end |
( |
bool | allow_rampdown | ) |
|
|
inlinevirtual |
Ends the processing. If either setPlayTime() or setRampTimes() have been set, then allow_rampdown=true will start a ramp-down instead of stopping immediately.
◆ isActive()
template<class T = int16_t>
| virtual bool isActive |
( |
| ) |
|
|
inlinevirtual |
Checks if the begin method has been called - after end() isActive is false.
◆ readBytes()
template<class T = int16_t>
| virtual size_t readBytes |
( |
uint8_t * | data, |
|
|
size_t | len ) |
|
inlinevirtual |
Provides the data as byte array with the requested number of channels.
◆ readBytesFrames()
template<class T = int16_t>
| size_t readBytesFrames |
( |
uint8_t * | buffer, |
|
|
size_t | lengthBytes, |
|
|
int | frames, |
|
|
int | channels ) |
|
inlineprotected |
◆ readBytesFromBuffer()
template<class T = int16_t>
| size_t readBytesFromBuffer |
( |
uint8_t * | buffer, |
|
|
size_t | lengthBytes, |
|
|
int | frame_size, |
|
|
int | channels ) |
|
inlineprotected |
◆ readSample()
template<class T = int16_t>
Provides a single sample.
◆ readSamples()
template<class T = int16_t>
| virtual size_t readSamples |
( |
T * | data, |
|
|
size_t | len ) |
|
inlinevirtual |
Provides the data as T array (interleaved by channel) with the requested number of samples (values, not frames)
◆ recalculatePlayTime()
template<class T = int16_t>
| void recalculatePlayTime |
( |
| ) |
|
|
inlineprotected |
◆ restart()
template<class T = int16_t>
Restarts the generator, e.g. after a play time has been defined and reached.
◆ setAudioInfo()
template<class T = int16_t>
◆ setFrequency()
template<class T = int16_t>
| virtual void setFrequency |
( |
float | frequency | ) |
|
|
inlinevirtual |
Abstract method: not implemented! Just provides an error message...
◆ setPlayTime()
template<class T = int16_t>
| virtual void setPlayTime |
( |
uint32_t | playMs, |
|
|
uint8_t | upPercent = 20, |
|
|
uint8_t | downPercent = 30 ) |
|
inlinevirtual |
Defines the play time in ms and the ramp up and ramp down time in percent.
◆ setRampTimes()
template<class T = int16_t>
| virtual void setRampTimes |
( |
uint32_t | playMs, |
|
|
uint32_t | upMs = 5, |
|
|
uint32_t | downMs = 5 ) |
|
inlinevirtual |
Alternative to setPlayTime. It sets ramp-up and ramp-down times in ms instead of percentages. If playMs == 0, it will play indefinitely. restart();begin(); starts the ramp-up and sustain as normal, but it will sustain forever. end(true) triggers a ramp-down then inactive.
◆ active
template<class T = int16_t>
◆ activeWarningIssued
template<class T = int16_t>
| bool activeWarningIssued = false |
|
protected |
◆ currentSample
template<class T = int16_t>
| uint32_t currentSample = 0 |
|
protected |
◆ downMs
template<class T = int16_t>
◆ downPercent
template<class T = int16_t>
◆ downSamples
template<class T = int16_t>
◆ factor
template<class T = int16_t>
◆ info
template<class T = int16_t>
◆ playMs
template<class T = int16_t>
◆ playSamples
template<class T = int16_t>
◆ rampDownDec
template<class T = int16_t>
◆ rampUpInc
template<class T = int16_t>
◆ ring_buffer
template<class T = int16_t>
◆ upMs
template<class T = int16_t>
◆ upPercent
template<class T = int16_t>
◆ upSamples
template<class T = int16_t>
The documentation for this class was generated from the following file: