Skip to content

setMetadataCallback() not working with ICYStreamBuffered #2199

@wiktorbpl

Description

@wiktorbpl

Problem Description

In my project, I'm using ICYStreamBuffered (for ESP32-S3-Zero with 2MB PSRAM + PCM5102) and I want to receive ICY messages.
Unfortunately, the following code doesn't work:

ICYStreamBuffered url(WIFI_SSID, WIFI_PSK);
...
// callback for meta data
void printMetaData(MetaDataType type, const char* str, int len){
  Serial.print("==> ");
  Serial.print(toStr(type));
  Serial.print(": ");
  Serial.println(str);
}
...
bool result = url.setMetadataCallback(printMetaData);

After calling setMetadataCallback, I get: result equals false and the log message:
[W] MetaDataICY.h : 260 - callback not defined
Probably a method from the AbstractURLStream class is being called.
If I change ICYStreamBuffered to ICYStream, everything works correctly, but I don't have an additional buffer for the stream.

Is this intended behavior or a defect? ​​If intended, how should it be implemented?

Device Description

ESP32-S3-Zero with 2MB PSRAM + PCM5102

Sketch

ICYStreamBuffered url(WIFI_SSID, WIFI_PSK);
// ...
// callback for meta data
void printMetaData(MetaDataType type, const char* str, int len){
  Serial.print("==> ");
  Serial.print(toStr(type));
  Serial.print(": ");
  Serial.println(str);
}
// ...
bool result = url.setMetadataCallback(printMetaData);

Other Steps to Reproduce

No response

What is your development environment (incl. core version info)

No response

I have checked existing issues, discussions and online documentation (incl. the Wiki)

  • I confirm I have checked existing issues, discussions and online documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions