|
arduino-audio-tools
|
HTTP Live Streaming using HLS: The resulting .ts data is provided via readBytes() that dynamically reload new Segments. Please note that this reloading adds a considerable delay: So if you want to play back the audio, you should buffer the content in a seaparate task. More...
#include <HLSStream.h>
Public Member Functions | |
| HLSStreamT ()=default | |
| Empty constructor. | |
| HLSStreamT (const char *ssid, const char *password) | |
| Convenience constructor which logs in to the WiFi. | |
| 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 |
| Provides number of available bytes in the read buffer. | |
| int | availableForWrite () override |
| Writes are not supported. | |
| bool | begin () override |
| Reopens the last url. | |
| bool | begin (const char *urlStr) |
| Open an HLS url. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| const char * | codec () |
| Returns the string representation of the codec of the audio stream. | |
| int | contentLength () override |
| Provides the content length of the actual .ts Segment. | |
| const char * | contentType () |
| Provides the content type from the http reply. | |
| void | end () override |
| ends the request | |
| virtual void | flush () override |
| const char * | getReplyHeader (const char *header) override |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| const char * | mime () override |
| Provides the MIME type for the current stream. | |
| virtual | operator bool () |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Provides the data fro the next .ts Segment. | |
| 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 void | setAudioInfo (AudioInfo newInfo) override |
| Defines the input AudioInfo. | |
| void | setBufferSize (int size, int count) |
| Redefines the read buffer size. | |
| void | setCACert (const char *cert) override |
| Defines the certificate. | |
| void | setConnectionClose (bool flag) override |
| not implemented | |
| virtual bool | setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len)) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setPassword (const char *password) override |
| Sets the password that will be used for logging in (when calling begin) | |
| void | setPowerSave (bool flag) override |
| Changes the Wifi to power saving mode. | |
| void | setSSID (const char *ssid) override |
| Sets the ssid that will be used for logging in (when calling begin) | |
| void | setURLResolver (const char *(*cb)(const char *segment, const char *reqURL)) |
| void | setWriteBufferSize (int size) |
| size_t | totalRead () override |
| Total amout of data that was consumed so far. | |
| const char * | urlStr () override |
| Provides the url as string. | |
| bool | waitForData (int timeout) override |
| not implemented | |
| virtual size_t | write (const uint8_t *data, size_t len) override |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| void | addRequestHeader (const char *header, const char *value) override |
| Not implemented. | |
| bool | begin (const char *urlStr, const char *acceptMime, MethodID action=GET, const char *reqMime="", const char *reqData="") override |
| Added to comply with AbstractURLStream. | |
| HttpRequest & | httpRequest () override |
| provides access to the HttpRequest | |
| void | login () |
| 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() | |
| void | setClient (Client &clientPar) override |
| Not implemented: potential future improvement. | |
Protected Attributes | |
| int | _timeout = 10 |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| audio_tools_hls::HLSParser< URLStream > | parser |
| const char * | password = nullptr |
| const char * | ssid = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = MAX_SINGLE_CHARS |
HTTP Live Streaming using HLS: The resulting .ts data is provided via readBytes() that dynamically reload new Segments. Please note that this reloading adds a considerable delay: So if you want to play back the audio, you should buffer the content in a seaparate task.
|
default |
Empty constructor.
|
inline |
Convenience constructor which logs in to the WiFi.
|
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.
|
inlineoverrideprotectedvirtual |
Not implemented.
Implements AbstractURLStream.
|
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 |
Provides number of available bytes in the read buffer.
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
|
inlineoverridevirtual |
Reopens the last url.
Reimplemented from BaseStream.
|
inline |
Open an HLS url.
|
inlineoverrideprotectedvirtual |
Added to comply with AbstractURLStream.
Implements AbstractURLStream.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Returns the string representation of the codec of the audio stream.
|
inlineoverridevirtual |
Provides the content length of the actual .ts Segment.
Implements AbstractURLStream.
|
inline |
Provides the content type from the http reply.
|
inlineoverridevirtual |
ends the request
Implements AbstractURLStream.
|
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.
|
inlineoverridevirtual |
Custom logic to provide the codec as Content-Type to support the MultiCodec
Implements AbstractURLStream.
|
inlineoverrideprotectedvirtual |
provides access to the HttpRequest
Implements AbstractURLStream.
|
inlineinherited |
Checks if the automatic AudioInfo update is active.
|
inlineprotected |
|
inlineoverridevirtualinherited |
Provides the MIME type for the current stream.
Implements MimeSource.
|
inlineprotectedvirtualinherited |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
|
inlineoverridevirtual |
Provides the data fro the next .ts Segment.
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 >.
|
inlineoverridevirtualinherited |
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in VS1053Stream, WM8960Stream, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, VolumeStream, MiniAudioStream, PortAudioStream, I2SCodecStream, MozziStream, SPDIFOutput, AudioLoRa, AnalogAudioStream, I2SStream, TimerCallbackAudioStream, AudioBLEStream, MDFEchoCancellationStream< T, SampleType >, AudioKitStream, NRF24Stream, SPIAudioSlave, USBAudioDeviceBase, VBANStream, Equalizer3Bands, Equalizer3BandsPerChannel, AdapterAudioOutputToAudioStream, TimedStream, MeasuringStream, ProgressStream, CallbackStream, VolumeMeter, AudioInputMonitor, FormatConverterStream, FadeStream, GoertzelStream, Pipeline::ModifyingStreamAdapter, QualityAnalysisStream, AudioFFTBase, EncodedAudioStream, PureDataStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inline |
Redefines the read buffer size.
|
inlineoverridevirtual |
Defines the certificate.
Implements AbstractURLStream.
Not implemented: potential future improvement.
Implements AbstractURLStream.
|
inlineoverridevirtual |
not implemented
Implements AbstractURLStream.
|
inlinevirtualinherited |
Reimplemented in ICYStreamBuffered, and ICYStreamT< T >.
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlineoverridevirtual |
Sets the password that will be used for logging in (when calling begin)
Implements AbstractURLStream.
|
inlineoverridevirtual |
Changes the Wifi to power saving mode.
Implements AbstractURLStream.
|
inlineoverridevirtual |
Sets the ssid that will be used for logging in (when calling begin)
Implements AbstractURLStream.
|
inline |
The resolving of relative addresses can be quite tricky: you can provide your custom resolver implementation
|
inlineinherited |
|
inlineoverridevirtual |
Total amout of data that was consumed so far.
Implements AbstractURLStream.
|
inlineoverridevirtual |
Provides the url as string.
Implements AbstractURLStream.
|
inlineoverridevirtual |
not implemented
Implements AbstractURLStream.
|
inlineoverridevirtualinherited |
Implements BaseStream.
Reimplemented in URLStream, LMSEchoCancellationStream< T >, MDFEchoCancellationStream< T, SampleType >, AudioBLEServer, ESP3288AudioOutput, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, AudioLoRa, USBAudioDeviceBase, I2SStream, AudioStreamWrapper, ConverterStream< T >, EncodedAudioStream, FaustStream< DSP >, AudioKitStream, MiniAudioStream, PortAudioStream, TfLiteAudioStream, VS1053Stream, A2DPStream, AdaptiveResamplingStream, BufferedTaskStream, URLStreamESP32, NRF24Stream, SPIAudioSlave, VBANStream, AnalogAudioStream, AudioEffectStreamT< T >, AudioEffectStream, Equalizer3Bands, Equalizer3BandsPerChannel, AdapterAudioOutputToAudioStream, TimedStream, MemoryStream, RingBufferStream, BufferedStream, MeasuringStream, ProgressStream, Throttle, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, VolumeMeter, AudioInputMonitor, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, GoertzelStream, Pipeline, Pipeline::ModifyingStreamAdapter, QualityAnalysisStream, ResampleStream, ResampleStreamT< TInterpolator >, VolumeStream, AudioFFTBase, AudioBLEClient, AudioBLEClient, AudioBLEServer, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, TfLiteAudioStreamBase, WM8960Stream, AnalogDriverESP32V1::IO16Bit, and AnalogDriverESP32V2::IO16Bit.
|
inlineoverridevirtualinherited |
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |