Web Radio

Hello,
I am doing a web radio (wifi) based arduino (EPS32 card and VS1053).
I found a start code and all the material and it works … almost.
Indeed in the found code, there are several “stations” but they do not all work.

But my real concern is to add my “radio stations”.
I do not understand how to write them in the code. an example of a station:
https://www.static.rtbf.be/radio/classic21/m3u/wr-classic21-60-mp3.m3u
https://www.static.rtbf.be/radio/classic21/m3u/wr-classic21-60-mp3.pls
or
https://www.rtbf.be/classic21/webradio

In the best case, the card connects but no sound comes out.
here is the code and thank you in advance for your help.

/*
airspectrum.cdnstream1.com:8114/1648_128 #  1 - Easy Hits Florida 128k Y
109.206.96.34:8100                       #  0 - NAXI LOVE RADIO, Belgrade, Serbia
us2.internet-radio.com:8050              #  2 - CLASSIC ROCK MIAMI 256k
airspectrum.cdnstream1.com:8000/1261_192 #  3 - Magic Oldies Florida
airspectrum.cdnstream1.com:8008/1604_128 #  4 - Magic 60s Florida 60s Classic Rock
us1.internet-radio.com:8105              #  5 - Classic Rock Florida - SHE Radio
icecast.omroep.nl:80/radio1-bb-mp3       #  6 - Radio 1, NL
205.164.62.15:10032                      #  7 - 1.FM - GAIA, 64k
skonto.ls.lv:8002/mp3                    #  8 - Skonto 128k
94.23.66.155:8106                        #  9 - *ILR CHILL and GROOVE

 "http://wbgo.streamguys.net/wbgo96",
  "http://wbgo.streamguys.net/thejazzstream",
  "http://stream.srg-ssr.ch/m/rsj/mp3_128",
  "http://37.187.79.93:8368/stream2",
  "http://icecast.omroep.nl/3fm-sb-mp3",
  "http://beatles.purestream.net/beatles.mp3",
  "http://listen.181fm.com/181-beatles_128k.mp3",

Connections of the remaining pins of VS1053
 XRST = EN (D3)
 MISO = D19
 MOSI = D23
 SCLK = D18
 VCC = 5V / 3.3 V
 Gnd = Gnd 
  
*/

// This ESP_VS1053_Library
#include <VS1053.h>
#include "helloMp3.h"
#include <WiFi.h>
#include <HTTPClient.h>
#include <esp_wifi.h>

char ssid[] = "WiFi-2.4-xxxx";    //  your network SSID (name) 
char pass[] = "xxxx";   // your network password

// Few Radio Stations
char *host[7] = {"http://www.rtbfradioplayer.be","https://www.static.rtbf.be","https://www.internet-radio.com", "airspectrum.cdnstream1.com","skonto.ls.lv","icecast.omroep.nl","beatles.purestream.net"};
char *path[7] = {"/radio/liveradio/webradio-classic21-60","/radio/classic21/m3u/wr-classic21-60-mp3.pls","/station/douglassinclair/","/mp3 ","/radio1-bb-mp3","/beatles.mp3"};
int   port[7] = {80,80,80,80,8002,80,80};

int status = WL_IDLE_STATUS;
WiFiClient  client;
uint8_t mp3buff[32];   // vs1053 likes 32 bytes at a time

// Wiring of VS1053 board (SPI connected in a standard way)
#define VS1053_CS    32 //32
#define VS1053_DCS   33 //33
#define VS1053_DREQ  35 //15


#define VOLUME  100 // volume level 0-100
VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ);

int ledPin = 15;

void setup () {
   Serial.begin(115200);
   delay(500);
// initialize SPI bus;
    SPI.begin();

// initialize VS1053 player
    player.begin();
    //player.switchToMp3Mode(); // optional, some boards require this
    player.setVolume(VOLUME);


    pinMode (ledPin,OUTPUT);


    digitalWrite (ledPin, HIGH);
    delay [100];
    digitalWrite (ledPin,LOW);


   
   WiFi.begin(ssid, pass);
   while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
   }
  Serial.println("WiFi connected");  
  player.playChunk(hello2, sizeof(hello2)); //VS1053 is wake up & running

  station_connect(6); 
}

void loop() {
      if (client.available() > 0) {
      uint8_t bytesread = client.read(mp3buff, 32);
      player.playChunk(mp3buff, bytesread);
      }
}    
  
  
void station_connect (int station_no ) {
    if (client.connect(host[station_no],port[station_no]) ){
      Serial.println("Connected now");
       Serial.println(host[station_no]);
       digitalWrite (ledPin,HIGH);
    }
      
    client.print(String("GET ") + path[station_no] + " HTTP" + "Host: " + host[station_no] + "\r\n" + "Connection: close\r\n\r\n");     
  }

[code]

I managed to get out of the sound of my editing.
There is 7 “station” in the code, the last one works normally.
I changed the first two and I have some sound but it is too slow.
It looks like a 48Tours turning in 33.

I tried modifying some parameters (32> 128) and nothing helps.
Do you have an idea?

Here is the code

/*

Connections of the remaining pins of VS1053
 XRST = EN (D3)
 MISO = D19
 MOSI = D23
 SCLK = D18
 VCC = 5V / 3.3 V
 Gnd = Gnd 
  
*/

// This ESP_VS1053_Library
#include <VS1053.h>
#include "helloMp3.h"
#include <WiFi.h>
#include <HTTPClient.h>
#include <esp_wifi.h>

char ssid[] = "WiFi-2.4-xxxx";    //  your network SSID (name) 
char pass[] = "xxxx";   // your network password

// Few Radio Stations
char *host[7] = {"radios.rtbf.be","radios.rtbf.be","/swr/swr1/bw/mp3/64/stream.mp3", "airspectrum.cdnstream1.com","skonto.ls.lv",
"icecast.omroep.nl","beatles.purestream.net"};
char *path[7] = {"/wr-c21-60-128.mp3","/wr-c21-blues-128.mp3","/1261_192","/1604_128","/mp3 ",
"/radio1-bb-mp3","/beatles.mp3"};
int   port[7] = {80,80,8000,8008,8002,80,80};


int status = WL_IDLE_STATUS;
WiFiClient  client;
uint8_t mp3buff[128];   // vs1053 likes 32 bytes at a time

// Wiring of VS1053 board (SPI connected in a standard way)
#define VS1053_CS    32 //32
#define VS1053_DCS   33  //33
#define VS1053_DREQ  35 //15


#define VOLUME  50 // volume level 0-100
VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ);

const int ledPin = 15;

void setup () {

  pinMode(ledPin, OUTPUT);
 digitalWrite(ledPin, HIGH);
 delay (100);
 digitalWrite(ledPin, LOW);
 delay (100);

  
   Serial.begin(115200);
   delay(500);
   
// initialize SPI bus;
   SPI.begin();

// initialize VS1053 player
    player.begin();
//  player.switchToMp3Mode(); // optional, some boards require this
    player.setVolume(VOLUME);


   
   WiFi.begin(ssid, pass);
   while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
   }
  Serial.println("WiFi connected");  
player.playChunk(hello2, sizeof(hello2)); //VS1053 is wake up & running
station_connect(1); 
}

void loop() {
      if (client.available() > 0) {
      uint8_t bytesread = client.read(mp3buff, 128);
      player.playChunk(mp3buff, bytesread);
      }
}    
  
  
void station_connect (int station_no ) {
    if (client.connect(host[station_no],port[station_no]) ){
    Serial.println("Connected now"); 
    client.print(String("GET ") + path[station_no] + " HTTP/1.1\r\n" + "Host: " + host[station_no] + "\r\n" + "Connection: close\r\n\r\n");     
    digitalWrite(ledPin, HIGH);
    }
  }
[code]

[/code]

seems vs1053 can support upto 48kHz only

see its datasheet https_colon_//www.sparkfun.com/datasheets/Components/SMD/vs1053.pdf