arduino-audio-tools
|
Icecast/Shoutcast Metadata Handling. Metadata class which splits the data into audio and metadata. The result is provided via callback methods. see https://www.codeproject.com/Articles/11308/SHOUTcast-Stream-Ripper. More...
#include <MetaDataICY.h>
Public Member Functions | |
MetaDataICY (int metaint) | |
We just process the Metadata and ignore the audio info. | |
virtual void | begin () override |
Resets all counters and restarts the prcessing. | |
virtual void | end () override |
Resets all counters and restarts the prcessing. | |
virtual bool | hasMetaData () |
Returns true if the ICY stream contains metadata. | |
virtual bool | isData () |
returns true if the actual bytes is an audio data byte (e.g.mp3) | |
virtual int | metaInt () |
provides the metaint | |
virtual void | processChar (char ch) |
character based state engine | |
virtual void | setAudioDataCallback (void(*fn)(const uint8_t *str, int len), int bufferLen=1024) |
Defines the audio callback function. | |
virtual void | setCallback (void(*fn)(MetaDataType info, const char *str, int len)) override |
Defines the metadata callback function. | |
virtual void | setIcyMetaInt (int value) override |
Defines the ICE metaint value which is provided by the web call! | |
virtual Status | status () |
Returns the actual status of the state engine for the current byte. | |
virtual size_t | write (const uint8_t *data, size_t len) override |
Writes the data in order to retrieve the metadata and perform the corresponding callbacks. | |
Protected Member Functions | |
virtual void | clear () |
virtual bool | isAscii (char *result, int l) |
Make sure that the result is a valid ASCII string. | |
virtual int | metaSize (uint8_t metaSize) |
determines the meta data size from the size byte | |
virtual void | processData (char ch) |
Collects the data in a buffer and executes the callback when the buffer is full. | |
virtual void | processMetaData (char *metaData, int len) |
e.g. StreamTitle=' House Bulldogs - But your love (Radio Edit)';StreamUrl=''; | |
virtual void | setupMetaData (int meta_size) |
allocates the memory to store the metadata / we support changing sizes | |
Protected Attributes | |
void(* | callback )(MetaDataType info, const char *str, int len) = nullptr |
Status | currentStatus = ProcessData |
uint8_t * | dataBuffer =nullptr |
void(* | dataCallback )(const uint8_t *str, int len) = nullptr |
int | dataLen = 0 |
int | dataPos = 0 |
bool | is_data |
char * | metaData =nullptr |
int | metaDataLen = 0 |
int | metaDataMaxLen = 0 |
int | metaDataPos = 0 |
int | mp3_blocksize = 0 |
Status | nextStatus = ProcessData |
int | totalData = 0 |
Icecast/Shoutcast Metadata Handling. Metadata class which splits the data into audio and metadata. The result is provided via callback methods. see https://www.codeproject.com/Articles/11308/SHOUTcast-Stream-Ripper.