We generate the samples from an array which is provided in the constructor.
More...
#include <SoundGenerator.h>
|
template<size_t arrayLen> |
| GeneratorFromArray (T(&array)[arrayLen], int repeat=0, bool setInactiveAtEnd=false, size_t startIndex=0) |
| Construct a new Generator from an array. More...
|
|
virtual AudioInfo | audioInfo () |
| Provides the AudioInfo.
|
|
bool | begin () override |
| Starts the generation of samples.
|
|
virtual bool | begin (AudioInfo info) override |
|
virtual AudioInfo | defaultConfig () |
| Provides the default configuration.
|
|
virtual void | end () |
| ends the processing
|
|
virtual bool | isActive () |
|
bool | isRunning () |
|
virtual size_t | readBytes (uint8_t *data, size_t len) |
| Provides the data as byte array with the requested number of channels.
|
|
T | readSample () override |
| Provides a single sample.
|
|
void | setArray (T *array, size_t size) |
|
template<int arrayLen> |
void | setArray (T(&array)[arrayLen]) |
|
virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo.
|
|
virtual void | setFrequency (float frequency) |
| Abstract method: not implemented! Just provides an error message...
|
|
void | setIncrement (int inc) |
|
int | setupSine (int sampleRate, float reqFrequency, float amplitude=1.0) |
|
|
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) |
|
|
bool | active = false |
|
bool | activeWarningIssued = false |
|
bool | inactive_at_end |
|
int | index_increment = 1 |
|
AudioInfo | info |
|
bool | is_running = false |
|
int | max_repeat = 0 |
|
bool | owns_data = false |
|
int | repeat_counter = 0 |
|
RingBuffer< uint8_t > | ring_buffer {0} |
|
int | sound_index = 0 |
|
T * | table = nullptr |
|
size_t | table_length = 0 |
|
template<class T>
class audio_tools::GeneratorFromArray< T >
We generate the samples from an array which is provided in the constructor.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
- Template Parameters
-
◆ GeneratorFromArray()
GeneratorFromArray |
( |
T(&) |
array[arrayLen], |
|
|
int |
repeat = 0 , |
|
|
bool |
setInactiveAtEnd = false , |
|
|
size_t |
startIndex = 0 |
|
) |
| |
|
inline |
Construct a new Generator from an array.
- Template Parameters
-
array | array of audio data of the the type defined as class template parameter |
- Parameters
-
repeat | number of repetions the array should be played, set to 0 for endless repeat. (default 0) |
setInactiveAtEnd | defines if the generator is set inactive when the array has played fully. Default is false. |
startIndex | defines if the phase. Default is 0. |
◆ 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: