|
arduino-audio-tools
|
Generic calss to measure the the total bytes which were processed in order to calculate the progress as a percentage of the total size. More...
#include <AudioStreams.h>
Public Member Functions | |
| ProgressStream ()=default | |
| ProgressStream (AudioStream &stream) | |
| ProgressStream (Print &print) | |
| ProgressStream (Stream &stream) | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| int | available () override |
| virtual int | availableForWrite () override |
| Provides the nubmer of bytes we can write. | |
| bool | begin () override |
| bool | begin (ProgressStreamInfo info) |
| bool | begin (size_t len) |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| ProgressStreamInfo & | defaultConfig () |
| virtual void | end () |
| virtual void | flush () override |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| float | percentage () |
| Provides the processed percentage: If no size has been defined we return 0. | |
| size_t | processedBytes () |
| Provides the number of processed bytes. | |
| size_t | processedSecs () |
| Provides the number of processed seconds. | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Provides the data from all streams mixed together. | |
| 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 | setAudioInfo (AudioInfo info) override |
| Defines the input AudioInfo. | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| virtual void | setOutput (AudioOutput &out) |
| Defines/Changes the output target and registers for audio change notifications. | |
| virtual void | setOutput (Print &out)=0 |
| Defines/Changes the output target. | |
| void | setPrint (Print &print) |
| void | setSize (size_t len) |
| Updates the total size and restarts the percent calculation. | |
| virtual void | setStream (AudioStream &io) |
| Defines/Changes the input & output and registers for audio change notifications. | |
| void | setStream (Print &print) |
| void | setStream (Stream &stream) override |
| Defines/Changes the input & output. | |
| void | setWriteBufferSize (int size) |
| size_t | size () |
| Provides the current total size (defined by setSize) | |
| size_t | totalBytes () |
| Provides the total_size provided in the configuration. | |
| size_t | totalSecs () |
| Converts the totalBytes() to seconds. | |
| virtual size_t | write (const uint8_t *data, size_t len) override |
| Writes raw PCM audio data, which will be the input for the volume control. | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| size_t | byteRate () |
| size_t | measure (size_t len) |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
Protected Attributes | |
| int | _timeout = 10 |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| AudioInfoSupport * | p_info_from = nullptr |
| Print * | p_print = nullptr |
| Stream * | p_stream = nullptr |
| ProgressStreamInfo | progress_info |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| size_t | total_processed = 0 |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Generic calss to measure the the total bytes which were processed in order to calculate the progress as a percentage of the total size.
|
default |
|
inline |
|
inline |
|
inline |
|
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.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Provides the nubmer of bytes we can write.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
|
inline |
Updates the total size and restarts the percent calculation: Same as calling setSize()
|
inlineprotected |
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
|
inlinevirtualinherited |
Reimplemented in FaustStream< DSP >, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, BufferedTaskStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, USBAudioDeviceBase, Equalizer3Bands, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FormatConverterStream, GoertzelStream, FileLoopT< FileType >, FileLoopT< File >, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, EncodedAudioStream, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, A2DPStream, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, URLStreamESP32, NRF24Stream, SPIAudioSlave, AnalogAudioStream, AudioEffectStreamT< T >, AudioEffectStream, 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, AudioFFTBase, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AbstractURLStream, and AudioBLEStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
|
inlineinherited |
Checks if the automatic AudioInfo update is active.
|
inlineprotected |
|
inlineprotectedvirtualinherited |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
|
inline |
Provides the processed percentage: If no size has been defined we return 0.
|
inline |
Provides the number of processed bytes.
|
inline |
Provides the number of processed seconds.
|
inlineoverridevirtual |
Provides the data from all streams mixed together.
Reimplemented from AudioStream.
|
inlinevirtualinherited |
Source to generate silence: just sets the buffer to 0.
|
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 >.
|
inlineoverridevirtual |
Defines the input AudioInfo.
Reimplemented from AudioStream.
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlinevirtualinherited |
Defines/Changes the output target and registers for audio change notifications.
Reimplemented in TimedStream, VolumeMeter, AudioInputMonitor, QualityAnalysisStream, ReformatBaseStream, FormatConverterStream, and EncodedAudioStream.
|
pure virtualinherited |
Defines/Changes the output target.
Implemented in ConverterStream< T >, EncodedAudioStream, Equalizer3Bands, Equalizer3BandsPerChannel, TimedStream, BufferedStream, MeasuringStream, Throttle, CallbackStream, VolumeMeter, AudioInputMonitor, FadeStream, Pipeline::ModifyingStreamAdapter, QualityAnalysisStream, VolumeStream, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, AudioEffectStream, AudioEffectStreamT< T >, ReformatBaseStream, FormatConverterStream, FilteredStream< T, TF >, and FilteredStream< int16_t, int16_t >.
|
inline |
|
inline |
Updates the total size and restarts the percent calculation.
|
inlinevirtualinherited |
Defines/Changes the input & output and registers for audio change notifications.
Reimplemented in VolumeMeter, AudioInputMonitor, QualityAnalysisStream, FormatConverterStream, ReformatBaseStream, TimedStream, and EncodedAudioStream.
|
inline |
|
inlineoverridevirtual |
Defines/Changes the input & output.
Implements ModifyingStream.
|
inlineinherited |
|
inline |
Provides the current total size (defined by setSize)
|
inline |
Provides the total_size provided in the configuration.
|
inline |
Converts the totalBytes() to seconds.
|
inlineoverridevirtual |
Writes raw PCM audio data, which will be the input for the volume control.
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |