schreibfaul1 / ESP32-vs1053_ext

With this library You can easily build a WebRadio with a ESP32 board and a mp3-module. See: https://www.youtube.com/watch?v=u4u9NvZvWRk
GNU General Public License v3.0
106 stars 29 forks source link

Unable to switch from SD > Web > SD #10

Closed B4stl3r closed 3 years ago

B4stl3r commented 3 years ago

Hi (oder auch servus),

I like the library very much, but if it want to switch (lets assume a button event) between sources, this wont work...

I start with a .mp3 from SD in setup(): player.connecttoSD("filename.mp3");

due to a button press, i switch to:

player.begin();
player.connecttohost("http://thiscouldbeastreamurl.fm/");

and with another button press i want to switch again to SD:

player.begin();
delay(10);
player.connecttoSD("anotherfilename.mp3");

There's no more audio output anymore when switching back to SD..

If i then switch back to Webstream I'm running into this line (885ff): if(vs1053_info) vs1053_info("Stream lost -> try new connection");

any ideas?

Thanks in advance!

clear-sky commented 3 years ago

please use WiFi.disconnect(); before player.connecttoSD("filename.mp3");

B4stl3r commented 3 years ago

I've reorganized my code and also changed the library a bit, now its working as in the example's.