|
arduino-audio-tools
|
Sine wave which is based on a fast approximation function using floating point math. More...
#include <CodecOpusOgg.h>
Public Member Functions | |
| FastSineGenerator (float amplitude=NumberConverter::maxValueT< T >(), float phase=0.0) | |
| FastSineGenerator (float amplitude=NumberConverter::maxValueT< T >(), float phase=0.0) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| bool | begin () override |
| virtual bool | begin (AudioInfo info) |
| Starts the processing with the provided AudioInfo. | |
| virtual AudioInfo | defaultConfig () override |
| 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. | |
| virtual T | readSample () override |
| Provides a single sample. | |
| virtual 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 | setAmplitude (float amp) |
| virtual void | setAudioInfo (AudioInfo info) override |
| Defines/updates the AudioInfo. | |
| void | setFrequency (float frequency) override |
| Defines the frequency - after the processing has been started. | |
| 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) |
| void | logStatus () |
| 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 () |
| float | sine (float t) |
| sine approximation. | |
| float | sine (float t) |
| sine approximation. | |
Protected Attributes | |
| bool | active |
| bool | activeWarningIssued |
| uint32_t | currentSample |
| const float | double_Pi |
| uint32_t | downMs |
| uint8_t | downPercent |
| uint32_t | downSamples |
| float | factor |
| AudioInfo | info |
| float | m_amplitude |
| float | m_cycles |
| float | m_deltaTime |
| volatile float | m_frequency |
| float | m_phase |
| uint32_t | playMs |
| uint32_t | playSamples |
| float | rampDownDec |
| float | rampUpInc |
| RingBuffer< uint8_t > | ring_buffer |
| uint32_t | upMs |
| uint8_t | upPercent |
| uint32_t | upSamples |
Sine wave which is based on a fast approximation function using floating point math.
| T |
|
inline |
|
inline |
|
inlineprotectedinherited |
|
inlineoverrideinherited |
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 >.
|
inlineoverridevirtualinherited |
Provides the default configuration.
Reimplemented from SoundGenerator< 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.
|
inlineprotectedinherited |
|
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.
Reimplemented from FloatSineGenerator< int16_t >.
|
inlineoverridevirtual |
Provides a single sample.
Reimplemented from FloatSineGenerator< 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.
|
inlineinherited |
|
inlineoverridevirtualinherited |
Defines/updates the AudioInfo.
Reimplemented from SoundGenerator< int16_t >.
|
inlineoverridevirtualinherited |
Defines the frequency - after the processing has been started.
Reimplemented from SoundGenerator< int16_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 |
|
inlineprotected |
sine approximation.
|
inlineprotected |
sine approximation.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |