From 65a6cc4be7d15335ae257d9768490c7263c6cbf8 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 15 Dec 2017 14:58:14 -0800 Subject: [PATCH] Fix MetadataCallback function signatures The MD callback now gets a string, not a stream, so update the examples to compile properly. --- examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino | 4 ++-- .../StreamMP3FromHTTP_SPIRAM/StreamMP3FromHTTP_SPIRAM.ino | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino b/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino index 4f689db..ef3fa89 100644 --- a/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino +++ b/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino @@ -21,11 +21,11 @@ AudioFileSourceBuffer *buff; AudioOutputI2SNoDAC *out; // Called when a metadata event occurs (i.e. an ID3 tag, an ICY block, etc. -void MDCallback(void *cbData, const char *type, bool isUnicode, Stream *stream) +void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string) { const char *ptr = reinterpret_cast(cbData); (void) isUnicode; // Punt this ball for now - Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, type, stream->readString().c_str()); + Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, type, string); Serial.flush(); } diff --git a/examples/StreamMP3FromHTTP_SPIRAM/StreamMP3FromHTTP_SPIRAM.ino b/examples/StreamMP3FromHTTP_SPIRAM/StreamMP3FromHTTP_SPIRAM.ino index 1b84f21..f8ad1f3 100644 --- a/examples/StreamMP3FromHTTP_SPIRAM/StreamMP3FromHTTP_SPIRAM.ino +++ b/examples/StreamMP3FromHTTP_SPIRAM/StreamMP3FromHTTP_SPIRAM.ino @@ -20,11 +20,11 @@ AudioFileSourceSPIRAMBuffer *buff; AudioOutputI2SNoDAC *out; // Called when a metadata event occurs (i.e. an ID3 tag, an ICY block, etc. -void MDCallback(void *cbData, const char *type, bool isUnicode, Stream *stream) +void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string) { const char *ptr = reinterpret_cast(cbData); (void) isUnicode; // Punt this ball for now - Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, type, stream->readString().c_str()); + Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, type, string); Serial.flush(); }