|
arduino-audio-tools
|
ESP8266Audio AudioOutput class which stores the data in a temporary buffer. The buffer can be consumed e.g. by a callback function by calling read(); Dependencies: ESP8266Audio Library Dependencies: ESP32-A2DP Library. More...
#include <AudioESP8266.h>
Public Member Functions | |
| AudioOutputWithCallback (int bufferSize, int bufferCount) | |
| virtual | ~AudioOutputWithCallback () |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| int | available () override |
| Returns the available bytes. | |
| virtual int | availableForWrite () override |
| virtual int | availableForWrite () override |
| virtual bool | begin () |
| Activates the output. | |
| virtual bool | begin (AudioInfo info) |
| void | clear () |
| Clears all the data in the buffer. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| virtual bool | ConsumeSample (int16_t sample[2]) |
| puts the sample into a buffer | |
| virtual void | end () |
| virtual void | end () |
| virtual void | flush () |
| void | flush () override |
| empties the buffer | |
| virtual bool | isDeletable () |
| If true we need to release the related memory in the destructor. | |
| 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 | |
| size_t | peekBytes (uint8_t *data, size_t len) |
| Provides data w/o consuming. | |
| int | read () override |
| reads a byte - to be avoided | |
| size_t | read (Frame *src, size_t len) |
| Provides the data from the internal buffer to the callback. | |
| 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 bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| void | resize (int size) |
| Resize the buffer. | |
| virtual void | setAudioInfo (AudioInfo newInfo) override |
| Defines the input AudioInfo. | |
| virtual void | setAudioInfo (AudioInfo newInfo) override |
| Defines the input AudioInfo. | |
| 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 | setStream (Print &out) |
| void | setStream (Stream &io) override |
| Defines/Changes the input & output. | |
| void | setWriteBufferSize (int size) |
| virtual bool | stop () |
| stops the processing | |
| size_t | write (const uint8_t *data, size_t len) override |
| Use this method: write an array. | |
| virtual size_t | write (const uint8_t *data, size_t len) override=0 |
| size_t | write (uint8_t c) override |
| writes a byte to the buffer | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | notifyAudioChange (AudioInfo info) |
| virtual size_t | readExt (uint8_t *data, size_t len) |
| void | refill () |
| refills the buffer with data from the source | |
| 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() | |
| virtual size_t | writeExt (const uint8_t *data, size_t len) |
Protected Attributes | |
| int | _timeout = 10 |
| int | _timeout = 10 |
| bool | active |
| SingleBuffer< uint8_t > | buffer {0} |
| NBuffer< Frame > * | callback_buffer_ptr |
| AudioInfo | cfg |
| AudioInfo | info |
| bool | is_active = false |
| bool | is_notify_active = true |
| bool | is_notify_active = true |
| size_t | minReadBufferSize = 1024 |
| Vector< AudioInfoSupport * > | notify_vector |
| Vector< AudioInfoSupport * > | notify_vector |
| Stream * | p_in = nullptr |
| Print * | p_out = nullptr |
| SingleBuffer< uint8_t > | tmp {MAX_SINGLE_CHARS} |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | tmpPos = 0 |
| int | write_buffer_size = MAX_SINGLE_CHARS |
ESP8266Audio AudioOutput class which stores the data in a temporary buffer. The buffer can be consumed e.g. by a callback function by calling read(); Dependencies: ESP8266Audio Library Dependencies: ESP32-A2DP Library.
|
inline |
|
inlinevirtual |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in AdapterPrintToAudioOutput, EncodedAudioOutput, and AdapterAudioStreamToAudioOutput.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtualinherited |
Returns the available bytes.
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in AudioESP32ULP, RTSPOutput< Platform >, SPIAudioMaster, EncodedAudioOutput, AudioServerEx, AudioSyncWriter, AdapterAudioStreamToAudioOutput, CsvOutput< T >, MemoryOutput, and PWMAudioOutput.
Reimplemented from Print.
Reimplemented in AudioLoRa, UDPStream, VBANStream, AudioStreamWrapper, ConverterStream< T >, LoRaStream, EncodedAudioStream, FaustStream< DSP >, AudioFFTBase, I2SCodecStream, MiniAudioStream, StdioStream, A2DPStream, ESPNowStream, HammingFEC< bytecount, block_t >, AbstractURLStream, URLStreamESP32, ReedSolomonFEC< bytecount, additional_bytes >, SPIAudioSlave, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, MeasuringStream, ProgressStream, Throttle, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, Pipeline, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, and AudioBLEServer.
Activates the output.
Reimplemented from AudioOutput.
Reimplemented in AudioESP32ULP, RTSPOutput< Platform >, RTTTLOutput< T >, ChannelsSelectOutput, CsvOutput< T >, and EncodedAudioOutput.
|
inlineinherited |
Clears all the data in the buffer.
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Reimplemented in FaustStream< DSP >, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, BufferedTaskStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, Equalizer3Bands, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FormatConverterStream, GoertzelStream, FileLoopT< FileType >, FileLoopT< File >, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, LoRaStream, EncodedAudioStream, AudioFFTBase, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, A2DPStream, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, URLStreamESP32, SPIAudioSlave, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3BandsPerChannel, ReformatBaseStream, AdapterAudioOutputToAudioStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, InputMixer< T, SumT >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStream, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, Pipeline, Pipeline::ModifyingStreamAdapter, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AbstractURLStream, and AudioBLEStream.
Reimplemented from Print.
Reimplemented in MultiOutput, and HexDumpOutput.
|
inlineoverridevirtualinherited |
empties the buffer
Reimplemented from BaseStream.
If true we need to release the related memory in the destructor.
Reimplemented in AdapterPrintToAudioOutput, and AdapterAudioStreamToAudioOutput.
Reimplemented in RTSPOutput< Platform >, EncodedAudioOutput, and AdapterAudioStreamToAudioOutput.
|
inlineoverrideinherited |
peeks a byte - to be avoided
|
inlineoverrideinherited |
reads a byte - to be avoided
Provides the data from the internal buffer to the callback.
Use this method !!
Reimplemented from AudioStream.
Reimplemented from BufferedStream.
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
refills the buffer with data from the source
|
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.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in ChannelsSelectOutput, AdapterPrintToAudioOutput, MultiOutput, SPIAudioMaster, AdapterAudioStreamToAudioOutput, CsvOutput< T >, PWMAudioOutput, and EncodedAudioOutput.
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in VS1053Stream, WM8960Stream, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, VolumeStream, MiniAudioStream, PortAudioStream, I2SCodecStream, MozziStream, SPDIFOutput, AudioLoRa, AnalogAudioStream, I2SStream, TimerCallbackAudioStream, AudioBLEStream, LoRaStream, AudioFFTBase, AudioKitStream, SPIAudioSlave, VBANStream, AnalogAudioArduino, Equalizer3Bands, Equalizer3BandsPerChannel, AdapterAudioOutputToAudioStream, TimedStream, MeasuringStream, ProgressStream, CallbackStream, VolumeMeter, AudioInputMonitor, FormatConverterStream, FadeStream, GoertzelStream, Pipeline::ModifyingStreamAdapter, MDFEchoCancellationStream< Allocator >, EncodedAudioStream, PureDataStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
Defines the minimum direct unbuffered read size to the original source (default is 1024)
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
Defines/Changes the output target.
Implements ModifyingStream.
Defines/Changes the input & output.
Implements ModifyingStream.
Use this method: write an array.
Reimplemented from AudioStream.
Reimplemented from Print.
Implemented in WakeWordDetector< T, N >, AudioWriterToAudioOutput, AudioESP32ULP, SPIAudioMaster, AdapterPrintToAudioOutput, MetaDataOutput, EncodedAudioOutput, OggContainerOutput, OSCContainerEncoder::OSCOutput, FFTEffect, R2ROutput, AudioServerEx, AudioSyncWriter, RTSPOutput< Platform >, WebSocketOutput, PitchShiftOutput< T, BufferT >, AdapterAudioStreamToAudioOutput, MultiOutput, ChannelsSelectOutput, MetaDataFilter, CsvOutput< T >, HexDumpOutput, MemoryOutput, ChannelSplitOutput, PWMAudioOutput, and RTTTLOutput< T >.
writes a byte to the buffer
Reimplemented from BaseStream.
Reimplemented in MetaDataOutput, and MultiOutput.
Reimplemented from BufferedStream.
Writes n 0 values (= silence)
| len |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |