|
arduino-audio-tools
|
Provides data from a concatenation of Streams. Please note that the provided Streams can be played only once! You will need to reset them (e.g. moving the file pointer to the beginning) and read them back if you want to process them a second time. The default timeout on the available() method is set to 0. This might be too small if you use e.g. a URLStream. If you set beginReset to true in the constructor, the system will automatically reset the streams when begin() is called. More...
#include <BaseStream.h>
Public Member Functions | |
| CatStream (bool beginReset=false) | |
| void | add (Stream &stream) |
| void | add (Stream *stream) |
| int | available () override |
| virtual int | availableForWrite () override |
| bool | begin () override |
| void | clear () |
| clear | |
| void | end () override |
| virtual void | flush () override |
| operator bool () | |
| Returns true if active and we still have data. | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| void | setAvailableCallback (int(*callback)(Stream *stream)) |
| Defines the callback used to determine available bytes for a stream. | |
| void | setOnBeginCallback (void(*callback)(Stream *stream)) |
| Defines the callback which is called when a new stream is started. | |
| void | setOnEndCallback (void(*callback)(Stream *stream)) |
| Defines the callback which is called when a stream is finished. | |
| void | setTimeout (size_t t) |
| Defines the timout in ms the system waits for data when moving to the next stream. | |
| void | setWriteBufferSize (int size) |
| size_t | write (const uint8_t *data, size_t size) override |
| not supported | |
| virtual size_t | write (uint8_t ch) override |
Protected Member Functions | |
| int | availableWithTimeout () |
| bool | moveToNextStreamOnEnd (bool force_next_stream=false) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| int | streamAvailable (Stream *stream) |
Protected Attributes | |
| int | _timeout = 10 |
| Vector< Stream * > | all_streams |
| int(* | available_callback )(Stream *stream) = nullptr |
| void(* | begin_callback )(Stream *stream) = nullptr |
| bool | begin_reset = false |
| void(* | end_callback )(Stream *stream) = nullptr |
| Vector< Stream * > | input_streams |
| bool | is_active = false |
| Stream * | p_current_stream = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Provides data from a concatenation of Streams. Please note that the provided Streams can be played only once! You will need to reset them (e.g. moving the file pointer to the beginning) and read them back if you want to process them a second time. The default timeout on the available() method is set to 0. This might be too small if you use e.g. a URLStream. If you set beginReset to true in the constructor, the system will automatically reset the streams when begin() is called.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
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.
|
inlineprotected |
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
clear
|
inlineoverridevirtual |
Reimplemented from BaseStream.
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.
moves to the next stream if necessary: returns true if we still have a valid stream
Implements BaseStream.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
Defines the callback used to determine available bytes for a stream.
Defines the callback which is called when a new stream is started.
Defines the callback which is called when a stream is finished.
Defines the timout in ms the system waits for data when moving to the next stream.
not supported
Implements BaseStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |