Examples to stream a mp3 from web server
Uksa007 opened this issue · 4 comments
Hi,
Are there any examples of how to stream a single mp3 from a web server available?
I note that playChunk seems to be blocking, is there any option in the library that use interrupts to make it non-blocking? I'm running a web server on the ESP8266 and so blocking is not so good.
void playChunk(uint8_t *data, size_t len); // Play a chunk of data. Copies the data to
// the chip. Blocks until complete.
Thanks.
Hi Uksa, sorry for inactivity. I'm a bit busy recently. I will have a look again to your question soon.
But in general I would say examples are available.
In the meantime I would suggest to have a look into https://github.com/Edzelf/Esp-radio which is the project I forked. It works with web server. It's kind of example for this library (somewhere in this long source code). In ESP_VS1053_Library I extracted only the root base from Esp-radio to be reused in different projects.
Also the Esp-radio should show how to work with buffers. It's good to mention that better results will be possible with Esp32 module (example is Edzelf/ESP32-Radio). My library supports both modules.
Hope this helps for now @Uksa007 ? Please leave the feedback.
Regards, Marcin
Hi,
I had a look at ESP32-Radio, its a complex beast, kind of hard to pinpoint exactly how it streams.
I also don't have much luck getting it stream without pausing, maybe the buffer is too small.
I ended up writing my streaming code, which mostly works, just working on making it non blocking.
Thanks for your reply. I'm happy you've managed to solve the issue.
I will close this ticket then for now.
In the near future I have a plan to provide some more examples regarding different things.
Also the community is very welcome to add some examples using this library.