|
arduino-audio-tools
|
Provides a fixed value (e.g. 0) as sound data. This can be used e.g. to test the output functionality which should optimally just output silence and no artifacts. More...
#include <CodecOpusOgg.h>
Public Member Functions | |
| SilenceGenerator (T value=0) | |
| SilenceGenerator (T value=0) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| virtual bool | begin (AudioInfo info) |
| Starts the processing with the provided AudioInfo. | |
| virtual AudioInfo | defaultConfig () |
| Provides the default configuration. | |
| virtual void | end () |
| virtual bool | isActive () |
| Checks if the begin method has been called - after end() isActive is false. | |
| virtual size_t | readBytes (uint8_t *data, size_t len) |
| Provides the data as byte array with the requested number of channels. | |
| T | readSample () |
| Provides a single sample. | |
| T | readSample () |
| 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. | |
| virtual void | setAudioInfo (AudioInfo info) |
| Defines/updates the AudioInfo. | |
| virtual void | setFrequency (float frequency) |
| Abstract method: not implemented! Just provides an error message... | |
| 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) |
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 |
| AudioInfo | info |
| uint32_t | playMs |
| uint32_t | playSamples |
| float | rampDownDec |
| float | rampUpInc |
| RingBuffer< uint8_t > | ring_buffer |
| uint32_t | upMs |
| uint8_t | upPercent |
| uint32_t | upSamples |
| T | value |
Provides a fixed value (e.g. 0) as sound data. This can be used e.g. to test the output functionality which should optimally just output silence and no artifacts.
|
inline |
|
inline |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Starts the processing with the provided AudioInfo.
Reimplemented in FastIntSineGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< T >, GeneratorFixedValue< T >, GeneratorFixedValue< T >, GeneratorFromArray< T >, GeneratorFromArray< T >, SawToothGenerator< T >, SawToothGenerator< T >, SquareWaveGenerator< T >, and SquareWaveGenerator< T >.
|
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 >.
|
inlinevirtualinherited |
Reimplemented in GeneratorFromArray< T >, GeneratorFromArray< T >, GeneratorQueue< T >, GeneratorQueue< T >, GeneratorFromArray< T >, and GeneratorQueue< T >.
|
inlinevirtualinherited |
Checks if the begin method has been called - after end() isActive is false.
|
inlinevirtualinherited |
Provides the data as byte array with the requested number of channels.
Reimplemented in GeneratorQueue< T >, GeneratorQueue< T >, and GeneratorQueue< T >.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinevirtual |
Provides a single sample.
Implements SoundGenerator< int16_t >.
|
inlinevirtual |
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.
|
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 >.
|
inlinevirtualinherited |
Abstract method: not implemented! Just provides an error message...
Reimplemented in FastIntSineGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< T >, FloatSineGenerator< int16_t >, GeneratorFromArray< T >, GeneratorFromArray< T >, GeneratorQueue< T >, GeneratorQueue< T >, SawToothGenerator< T >, SawToothGenerator< T >, SineFromTable< T >, SineFromTable< T >, SquareWaveGenerator< T >, SquareWaveGenerator< T >, FastIntSineGenerator< T >, FloatSineGenerator< T >, GeneratorFromArray< T >, GeneratorQueue< T >, SawToothGenerator< T >, SineFromTable< T >, SquareWaveGenerator< T >, and STKInstrument< StkCls, T >.
|
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 |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |