|
arduino-audio-tools
|
We generate the samples from an array which is provided in the constructor. More...
#include <CodecOpusOgg.h>
Public Member Functions | |
| GeneratorFromArray ()=default | |
| GeneratorFromArray ()=default | |
| 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. | |
| 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. | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| bool | begin () override |
| Starts the generation of samples. | |
| bool | begin () override |
| Starts the generation of samples. | |
| bool | begin (AudioInfo info) override |
| Starts the generation of samples with the provided AudioInfo. | |
| bool | begin (AudioInfo info) override |
| Starts the generation of samples with the provided AudioInfo. | |
| bool | begin (AudioInfo info, float frequency) |
| Starts the generation of samples with the provided AudioInfo and frequency. | |
| bool | begin (AudioInfo info, float frequency) |
| Starts the generation of samples with the provided AudioInfo and frequency. | |
| virtual AudioInfo | defaultConfig () |
| Provides the default configuration. | |
| void | end () override |
| void | end () override |
| virtual bool | isActive () |
| Checks if the begin method has been called - after end() isActive is false. | |
| bool | isRunning () |
| 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. | |
| T | readSample () override |
| Provides a single sample. | |
| virtual size_t | readSamples (int16_t *data, size_t len) |
| virtual void | restart () |
| Restarts the generator, e.g. after a play time has been defined and reached. | |
| void | setArray (T *array, size_t size) |
| void | setArray (T *array, size_t size) |
| template<int arrayLen> | |
| void | setArray (T(&array)[arrayLen]) |
| template<int arrayLen> | |
| void | setArray (T(&array)[arrayLen]) |
| virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo. | |
| void | setFrequency (float frequency) override |
| Defines the output frequency based on sample rate and table size. | |
| void | setFrequency (float frequency) override |
| Defines the output frequency based on sample rate and table size. | |
| void | setIncrement (int inc) |
| void | setIncrement (int inc) |
| virtual void | setPlayTime (uint32_t playMs, uint8_t upPercent=20, uint8_t downPercent=30) |
| Defines the play time in ms and the ramp up and ramp down time in percent. | |
| virtual void | setRampTimes (uint32_t playMs, uint32_t upMs=5, uint32_t downMs=5) |
| int | setupSine (int sampleRate, float reqFrequency, float amplitude=1.0) |
| int | setupSine (int sampleRate, float reqFrequency, float amplitude=1.0) |
Protected Member Functions | |
| int16_t | applyRamp (int16_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 |
| uint32_t | downMs |
| uint8_t | downPercent |
| uint32_t | downSamples |
| float | factor |
| float | frequency = 0.0f |
| bool | inactive_at_end = false |
| float | index_increment = 1.0f |
| AudioInfo | info |
| bool | is_running = false |
| int | max_repeat = 0 |
| bool | owns_data = false |
| uint32_t | playMs |
| uint32_t | playSamples |
| float | rampDownDec |
| float | rampUpInc |
| int | repeat_counter = 0 |
| RingBuffer< uint8_t > | ring_buffer |
| float | sound_index = 0.0f |
| Vector< T > | table |
| uint32_t | upMs |
| uint8_t | upPercent |
| uint32_t | upSamples |
We generate the samples from an array which is provided in the constructor.
| T |
|
default |
|
inline |
Construct a new Generator from an array.
| array | array of audio data of the the type defined as class template parameter |
| 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. |
|
default |
|
inline |
Construct a new Generator from an array.
| array | array of audio data of the the type defined as class template parameter |
| 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. |
|
inlineprotectedinherited |
|
inlineoverride |
Starts the generation of samples.
|
inlineoverride |
Starts the generation of samples.
|
inlineoverridevirtual |
Starts the generation of samples with the provided AudioInfo.
Reimplemented from SoundGenerator< int16_t >.
|
inlineoverridevirtual |
Starts the generation of samples with the provided AudioInfo.
Reimplemented from SoundGenerator< int16_t >.
|
inline |
Starts the generation of samples with the provided AudioInfo and frequency.
|
inline |
Starts the generation of samples with the provided AudioInfo and frequency.
|
inlinevirtualinherited |
Provides the default configuration.
Reimplemented in FloatSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, FloatSineGenerator< T >, STKGenerator< StkCls, T >, STKGenerator< stk::Instrmnt, int16_t >, and STKGenerator< StkCls, int16_t >.
|
inlineoverridevirtual |
Reimplemented from SoundGenerator< int16_t >.
|
inlineoverridevirtual |
Reimplemented from SoundGenerator< int16_t >.
|
inlinevirtualinherited |
Checks if the begin method has been called - after end() isActive is false.
|
inline |
|
inline |
|
inlinevirtualinherited |
Provides the data as byte array with the requested number of channels.
Reimplemented in GeneratorQueue< T >, GeneratorQueue< T >, and GeneratorQueue< T >.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineoverridevirtual |
Provides a single sample.
Implements SoundGenerator< int16_t >.
|
inlineoverridevirtual |
Provides a single sample.
Implements SoundGenerator< int16_t >.
|
inlinevirtualinherited |
Provides the data as T array (interleaved by channel) with the requested number of samples (values, not frames)
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Restarts the generator, e.g. after a play time has been defined and reached.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtualinherited |
Defines/updates the AudioInfo.
Reimplemented in FastIntSineGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, SawToothGenerator< T >, SawToothGenerator< T >, SquareWaveGenerator< T >, and SquareWaveGenerator< T >.
|
inlineoverridevirtual |
Defines the output frequency based on sample rate and table size.
Reimplemented from SoundGenerator< int16_t >.
|
inlineoverridevirtual |
Defines the output frequency based on sample rate and table size.
Reimplemented from SoundGenerator< int16_t >.
|
inline |
|
inline |
|
inlinevirtualinherited |
Defines the play time in ms and the ramp up and ramp down time in percent.
Reimplemented in GeneratorQueue< T >, GeneratorQueue< T >, and GeneratorQueue< T >.
|
inlinevirtualinherited |
|
inline |
|
inline |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |