|
arduino-audio-tools
|
Callback driven Audio Source (rx_tx_mode==RX_MODE) or Audio Sink (rx_tx_mode==TX_MODE). This class allows to to integrate external libraries in order to consume or generate a data stream which is based on a timer. More...
#include <CodecOpusOgg.h>
Public Member Functions | |
| TimerCallbackAudioStream () | |
| TimerCallbackAudioStream () | |
| ~TimerCallbackAudioStream () | |
| ~TimerCallbackAudioStream () | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| AudioInfo | audioInfo () |
| provides the actual input AudioInfo | |
| AudioInfo | audioInfo () |
| provides the actual input AudioInfo | |
| TimerCallbackAudioStreamInfo | audioInfoExt () |
| Provides the current audio information. | |
| TimerCallbackAudioStreamInfo | audioInfoExt () |
| Provides the current audio information. | |
| virtual AudioInfo | audioInfoOut () |
| virtual AudioInfo | audioInfoOut () |
| int | available () override |
| Returns the available bytes. | |
| int | available () override |
| Returns the available bytes. | |
| virtual int | availableForWrite () override |
| virtual int | availableForWrite () override |
| bool | begin () |
| Restart the processing. | |
| bool | begin () |
| Restart the processing. | |
| void | begin (TimerCallbackAudioStreamInfo config) |
| void | begin (TimerCallbackAudioStreamInfo config) |
| void | clear () |
| Clears all the data in the buffer. | |
| void | clear () |
| Clears all the data in the buffer. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| uint16_t | currentSampleRate () |
| Provides the effective sample rate. | |
| uint16_t | currentSampleRate () |
| Provides the effective sample rate. | |
| TimerCallbackAudioStreamInfo | defaultConfig () |
| Provides the default configuration. | |
| TimerCallbackAudioStreamInfo | defaultConfig () |
| Provides the default configuration. | |
| void | end () |
| Stops the processing. | |
| void | end () |
| Stops the processing. | |
| void | flush () override |
| empties the buffer | |
| void | flush () override |
| empties the buffer | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| virtual | operator bool () |
| int | peek () override |
| peeks a byte - to be avoided | |
| int | peek () override |
| peeks a byte - to be avoided | |
| size_t | peekBytes (uint8_t *data, size_t len) |
| Provides data w/o consuming. | |
| size_t | peekBytes (uint8_t *data, size_t len) |
| Provides data w/o consuming. | |
| int | read () override |
| reads a byte - to be avoided | |
| int | read () override |
| reads a byte - to be avoided | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Use this method !! | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Use this method !! | |
| virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0. | |
| virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0. | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| void | resize (int size) |
| Resize the buffer. | |
| void | resize (int size) |
| Resize the buffer. | |
| virtual void | setAudioInfo (AudioInfo info) |
| updates the audio information | |
| virtual void | setAudioInfo (AudioInfo info) |
| updates the audio information | |
| void | setMinUnbufferedReadSize (size_t size) |
| void | setMinUnbufferedReadSize (size_t size) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active). | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active). | |
| void | setOutput (Print &out) override |
| Defines/Changes the output target. | |
| void | setOutput (Print &out) override |
| Defines/Changes the output target. | |
| virtual void | setOutput (AudioOutput &out) |
| Defines/Changes the output target and registers for audio change notifications. | |
| void | setStream (Print &out) |
| void | setStream (Print &out) |
| void | setStream (Stream &io) override |
| Defines/Changes the input & output. | |
| void | setStream (Stream &io) override |
| Defines/Changes the input & output. | |
| virtual void | setStream (AudioStream &io) |
| Defines/Changes the input & output and registers for audio change notifications. | |
| void | setWriteBufferSize (int size) |
| void | setWriteBufferSize (int size) |
| size_t | write (const uint8_t *data, size_t len) override |
| Use this method: write an array. | |
| size_t | write (const uint8_t *data, size_t len) override |
| Use this method: write an array. | |
| size_t | write (uint8_t c) override |
| writes a byte to the buffer | |
| size_t | write (uint8_t c) override |
| writes a byte to the buffer | |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| virtual void | measureSampleRate () |
| calculates the effective sample rate | |
| virtual void | measureSampleRate () |
| calculates the effective sample rate | |
| virtual int | not_supported (int out, const char *msg="") |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | notifyAudioChange (AudioInfo info) |
| virtual void | printSampleRate () |
| log and update effective sample rate | |
| virtual void | printSampleRate () |
| log and update effective sample rate | |
| virtual size_t | readExt (uint8_t *data, size_t len) override |
| virtual size_t | readExt (uint8_t *data, size_t len) override |
| void | refill () |
| refills the buffer with data from the source | |
| void | refill () |
| refills the buffer with data from the source | |
| void | refill (size_t len) |
| refill only if not enough data | |
| void | refill (size_t len) |
| refill only if not enough data | |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read(). | |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read(). | |
| virtual size_t | writeExt (const uint8_t *data, size_t len) override |
| virtual size_t | writeExt (const uint8_t *data, size_t len) override |
Protected Attributes | |
| int | _timeout = 10 |
| bool | active = false |
| RingBuffer< uint8_t > * | buffer = nullptr |
| TimerCallbackAudioStreamInfo | cfg |
| uint32_t | currentRateValue = 0 |
| uint8_t * | frame = nullptr |
| uint16_t(* | frameCallback )(uint8_t *data, uint16_t len) |
| uint16_t | frameSize = 0 |
| AudioInfo | info |
| bool | is_notify_active = true |
| unsigned long | lastTimestamp = 0u |
| size_t | minReadBufferSize = 1024 |
| Vector< AudioInfoSupport * > | notify_vector |
| Stream * | p_in = nullptr |
| Print * | p_out = nullptr |
| uint32_t | printCount = 0 |
| uint32_t | time = 0 |
| AudioTimer * | timer = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = 8 |
Friends | |
| void | timerCallback (void *obj) |
| void | timerCallback (void *obj) |
Callback driven Audio Source (rx_tx_mode==RX_MODE) or Audio Sink (rx_tx_mode==TX_MODE). This class allows to to integrate external libraries in order to consume or generate a data stream which is based on a timer.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, CodecNOP, EncodedAudioOutput, and EncodedAudioStream.
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, CodecNOP, EncodedAudioOutput, and EncodedAudioStream.
|
inlinevirtual |
provides the actual input AudioInfo
Reimplemented from AudioStream.
|
inlinevirtual |
provides the actual input AudioInfo
Reimplemented from AudioStream.
|
inline |
Provides the current audio information.
|
inline |
Provides the current audio information.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in ChannelFormatConverterStream, ChannelFormatConverterStreamT< T >, FormatConverterStream, MP3EncoderShine, NumberFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, Pipeline, PureDataStream, PWMAudioOutput< PWMDriverT >, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in ChannelFormatConverterStream, ChannelFormatConverterStreamT< T >, FormatConverterStream, MP3EncoderShine, NumberFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, Pipeline, PureDataStream, PWMAudioOutput< PWMDriverT >, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlineoverridevirtualinherited |
Returns the available bytes.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Returns the available bytes.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in A2DPStream, AbstractURLStream, AnalogAudioStream, AudioStreamWrapper, AudioStreamWrapper, ConverterStream< T >, ConverterStream< T >, DynamicMemoryStream, DynamicMemoryStream, EncodedAudioStream, FilteredStream< T, TF >, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, MemoryStream, MemoryStream, ProgressStream, ProgressStream, QueueStream< T >, QueueStream< T >, QueueStream< uint8_t >, ReformatBaseStream, RingBufferStream, RingBufferStream, Throttle, Throttle, TimedStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AudioEffectStream, AudioEffectStreamT< T >, AudioFFTBase, AudioLoRa, AudioStreamWrapper, AutomaticGainControlStream, ChannelFormatConverterStream, ChannelFormatConverterStreamT< T >, ConverterStream< T >, DynamicMemoryStream, EncodedAudioStream, Equalizer3BandsPerChannelT< T >, Equalizer3BandsPerChannelT< float >, Equalizer3BandsT< T >, Equalizer3BandsT< float >, ESPNowStream, FadeStream, FaustStream< DSP >, FilteredStream< T, TF >, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, HammingFEC< bytecount, block_t >, I2SCodecStream, I2SStream, MeasuringStream, MemoryStream, MiniAudioStream, NRF24Stream, NumberFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, Pipeline, ProgressStream, QualityAnalysisStream, QueueStream< T >, ReedSolomonFEC< bytecount, additional_bytes >, ReformatBaseStream, RingBufferStream, SPIAudioSlave, StdioStream, SupportedRatesStream, Throttle, TimedStream, UDPStream, URLStreamESP32, USBAudioStreamBase, VBANStream, and VolumeStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in A2DPStream, AbstractURLStream, AnalogAudioStream, AudioStreamWrapper, AudioStreamWrapper, ConverterStream< T >, ConverterStream< T >, DynamicMemoryStream, DynamicMemoryStream, EncodedAudioStream, FilteredStream< T, TF >, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, MemoryStream, MemoryStream, ProgressStream, ProgressStream, QueueStream< T >, QueueStream< T >, QueueStream< uint8_t >, ReformatBaseStream, RingBufferStream, RingBufferStream, Throttle, Throttle, TimedStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AudioEffectStream, AudioEffectStreamT< T >, AudioFFTBase, AudioLoRa, AudioStreamWrapper, AutomaticGainControlStream, ChannelFormatConverterStream, ChannelFormatConverterStreamT< T >, ConverterStream< T >, DynamicMemoryStream, EncodedAudioStream, Equalizer3BandsPerChannelT< T >, Equalizer3BandsPerChannelT< float >, Equalizer3BandsT< T >, Equalizer3BandsT< float >, ESPNowStream, FadeStream, FaustStream< DSP >, FilteredStream< T, TF >, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, HammingFEC< bytecount, block_t >, I2SCodecStream, I2SStream, MeasuringStream, MemoryStream, MiniAudioStream, NRF24Stream, NumberFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, Pipeline, ProgressStream, QualityAnalysisStream, QueueStream< T >, ReedSolomonFEC< bytecount, additional_bytes >, ReformatBaseStream, RingBufferStream, SPIAudioSlave, StdioStream, SupportedRatesStream, Throttle, TimedStream, UDPStream, URLStreamESP32, USBAudioStreamBase, VBANStream, and VolumeStream.
|
inlinevirtual |
Restart the processing.
Reimplemented from BaseStream.
|
inlinevirtual |
Restart the processing.
Reimplemented from BaseStream.
|
inline |
|
inline |
|
inlineinherited |
Clears all the data in the buffer.
|
inlineinherited |
Clears all the data in the buffer.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >, RTSPClient< EthernetClient, EthernetUDP >, and RTSPClient< WiFiClient, WiFiUDP >.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >, RTSPClient< EthernetClient, EthernetUDP >, and RTSPClient< WiFiClient, WiFiUDP >.
|
inline |
Provides the effective sample rate.
|
inline |
Provides the effective sample rate.
|
inline |
Provides the default configuration.
|
inline |
Provides the default configuration.
|
inlinevirtual |
Stops the processing.
Reimplemented from BaseStream.
|
inlinevirtual |
Stops the processing.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
empties the buffer
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
empties the buffer
Reimplemented from BaseStream.
|
inlineinherited |
Checks if the automatic AudioInfo update is active.
|
inlineinherited |
Checks if the automatic AudioInfo update is active.
|
inlineprotectedvirtual |
calculates the effective sample rate
|
inlineprotectedvirtual |
calculates the effective sample rate
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtualinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Reimplemented in A2DPStream, AdapterAudioOutputToAudioStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, MemoryStream, MemoryStream, TimedStream, AudioBLEStream, AudioFFTBase, GeneratedSoundStream< T >, I2SStream, ICYStreamT< T >, ICYStreamT< URLStream >, ICYStreamT< URLStreamESP32 >, MemoryStream, Pipeline, PortAudioStream, TimedStream, URLStream, and USBAudioStreamBase.
|
inlinevirtualinherited |
Reimplemented in A2DPStream, AdapterAudioOutputToAudioStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, MemoryStream, MemoryStream, TimedStream, AudioBLEStream, AudioFFTBase, GeneratedSoundStream< T >, I2SStream, ICYStreamT< T >, ICYStreamT< URLStream >, ICYStreamT< URLStreamESP32 >, MemoryStream, Pipeline, PortAudioStream, TimedStream, URLStream, and USBAudioStreamBase.
|
inlineoverrideinherited |
peeks a byte - to be avoided
|
inlineoverrideinherited |
peeks a byte - to be avoided
|
inlineinherited |
Provides data w/o consuming.
|
inlineinherited |
Provides data w/o consuming.
|
inlineprotectedvirtual |
log and update effective sample rate
|
inlineprotectedvirtual |
log and update effective sample rate
|
inlineoverrideinherited |
reads a byte - to be avoided
|
inlineoverrideinherited |
reads a byte - to be avoided
|
inlineoverridevirtualinherited |
Use this method !!
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
Use this method !!
Reimplemented from AudioStream.
|
inlineoverrideprotectedvirtual |
Reimplemented from BufferedStream.
|
inlineoverrideprotectedvirtual |
Reimplemented from BufferedStream.
|
inlinevirtualinherited |
Source to generate silence: just sets the buffer to 0.
|
inlinevirtualinherited |
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
refills the buffer with data from the source
|
inlineprotectedinherited |
refills the buffer with data from the source
|
inlineprotectedinherited |
refill only if not enough data
|
inlineprotectedinherited |
refill only if not enough data
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read().
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read().
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
|
inlineinherited |
Resize the buffer.
|
inlineinherited |
Resize the buffer.
|
inlinevirtual |
updates the audio information
Reimplemented from AudioStream.
|
inlinevirtual |
updates the audio information
Reimplemented from AudioStream.
|
inlineinherited |
Defines the minimum direct unbuffered read size to the original source (default is 1024)
|
inlineinherited |
Defines the minimum direct unbuffered read size to the original source (default is 1024)
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active).
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active).
|
inlineoverridevirtualinherited |
Defines/Changes the output target.
Implements ModifyingStream.
|
inlineoverridevirtualinherited |
Defines/Changes the output target.
Implements ModifyingStream.
|
inlinevirtualinherited |
Defines/Changes the output target and registers for audio change notifications.
Reimplemented in AudioInputMonitor, AudioInputMonitor, EncodedAudioStream, ReformatBaseStream, TimedStream, VolumeMeter, and VolumeMeter.
|
inlineinherited |
|
inlineinherited |
|
inlineoverridevirtualinherited |
Defines/Changes the input & output.
Implements ModifyingStream.
|
inlineoverridevirtualinherited |
Defines/Changes the input & output.
Implements ModifyingStream.
|
inlinevirtualinherited |
Defines/Changes the input & output and registers for audio change notifications.
Reimplemented in AudioInputMonitor, AudioInputMonitor, EncodedAudioStream, ReformatBaseStream, TimedStream, VolumeMeter, and VolumeMeter.
|
inlineinherited |
|
inlineinherited |
|
inlineoverridevirtualinherited |
Use this method: write an array.
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
Use this method: write an array.
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
writes a byte to the buffer
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
writes a byte to the buffer
Reimplemented from BaseStream.
|
inlineoverrideprotectedvirtual |
Reimplemented from BufferedStream.
|
inlineoverrideprotectedvirtual |
Reimplemented from BufferedStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
friend |
|
friend |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |