|
arduino-audio-tools
|
Sine wave which is based on a fast approximation function. More...
#include <SoundGenerator.h>
Public Member Functions | |
| FastSineGenerator (float amplitude=32767.0, float phase=0.0) | |
| virtual AudioInfo | audioInfo () |
| Provides the AudioInfo. | |
| bool | begin () override |
| bool | begin (AudioInfo info) override |
| bool | begin (AudioInfo info, float frequency) |
| bool | begin (int channels, int sample_rate, float frequency) |
| virtual AudioInfo | defaultConfig () override |
| Provides the default configuration. | |
| virtual void | end () |
| ends the processing | |
| virtual bool | isActive () |
| 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. | |
| 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. | |
| void | setPlayTime (uint32_t playMs, uint8_t upPercent=20, uint8_t downPercent=30) |
Protected Member Functions | |
| T | applyRamp (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. | |
Protected Attributes | |
| bool | active = false |
| bool | activeWarningIssued = false |
| uint32_t | currentSample = 0 |
| const float | double_Pi = 2.0f * PI |
| uint8_t | downPercent = 40 |
| float | factor = 1.0f |
| AudioInfo | info |
| float | m_amplitude = 1.0f |
| float | m_cycles = 0.0f |
| float | m_deltaTime = 0.0f |
| volatile float | m_frequency = 0.0f |
| float | m_phase = 0.0f |
| uint32_t | playMs = 0 |
| uint32_t | playSamples = 0 |
| float | rampDownDec = 0.0 |
| uint32_t | rampDownSamples = 0 |
| float | rampUpInc = 0.0 |
| RingBuffer< uint8_t > | ring_buffer {0} |
| uint8_t | upPercent = 5 |
| uint32_t | upSamples = 0 |
Sine wave which is based on a fast approximation function.
| T |
|
inline |
Provides the AudioInfo.
Reimplemented from SoundGenerator< T >.
Reimplemented from SoundGenerator< T >.
Provides the default configuration.
Reimplemented from SoundGenerator< T >.
ends the processing
Reimplemented in GeneratorFromArray< T >.
Checks if the begin method has been called - after end() isActive returns false
Provides the data as byte array with the requested number of channels.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
Provides a single sample.
Reimplemented from SineWaveGenerator< T >.
Reimplemented in SquareWaveGenerator< T >.
Defines/updates the AudioInfo.
Reimplemented from SoundGenerator< T >.
Defines the frequency - after the processing has been started.
Reimplemented from SoundGenerator< T >.
|
inlineinherited |
|
protectedinherited |