arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ICYStream Class Reference

Icecast/Shoutcast Audio Stream which splits the data into metadata and audio data. The Audio data is provided via the regular stream functions. The metadata is handled with the help of the MetaDataICY state machine and provided via a callback method. More...

#include <ICYStream.h>

Inheritance diagram for ICYStream:
AbstractURLStream AudioStream Stream AudioInfoSupport AudioInfoSource Print

Public Member Functions

 ICYStream (Client &clientPar, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 ICYStream (const char *network, const char *password, int readBufferSize=DEFAULT_BUFFER_SIZE)
 Default constructor.
 
 ICYStream (int readBufferSize=DEFAULT_BUFFER_SIZE)
 
virtual AudioInfo audioInfo () override
 
virtual int available () override
 provides the available method from the URLStream
 
int availableForWrite () override
 Writes are not supported.
 
virtual bool begin ()
 
virtual bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="") override
 
virtual void end () override
 Ends the processing.
 
virtual void flush () override
 
virtual HttpRequesthttpRequest () override
 provides access to the HttpRequest
 
 operator bool ()
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t len) override
 reads the audio bytes
 
virtual size_t readSilence (uint8_t *buffer, size_t length)
 Source to generate silence: just sets the buffer to 0.
 
virtual void setAudioInfo (AudioInfo info) override
 
void setClient (Client &client) override
 (Re-)defines the client
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len)) override
 Defines the meta data callback function.
 
virtual void setNotifyAudioChange (AudioInfoSupport &bi) override
 
void setPassword (const char *password) override
 Sets the password that will be used for logging in (when calling begin)
 
void setReadBufferSize (int readBufferSize)
 
void setSSID (const char *ssid) override
 Sets the ssid that will be used for logging in (when calling begin)
 
virtual bool validate (AudioInfo &info)
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 
virtual size_t write (uint8_t ch) override
 
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 refillReadBuffer ()
 

Protected Attributes

void(* callback )(MetaDataType info, const char *str, int len) =nullptr
 
MetaDataICY icy
 
AudioInfo info
 
AudioInfoSupportp_notify =nullptr
 
RingBuffer< uint8_t > tmp_in {0}
 
RingBuffer< uint8_t > tmp_out {0}
 
URLStream url
 

Detailed Description

Icecast/Shoutcast Audio Stream which splits the data into metadata and audio data. The Audio data is provided via the regular stream functions. The metadata is handled with the help of the MetaDataICY state machine and provided via a callback method.

This is basically just a URLStream with the metadata turned on.

Author
Phil Schatzmann

The documentation for this class was generated from the following file: