Adding #include <HTTPClient.h> #include <ArduinoJson.h> creates conflicts with #include <Audio.h>

I have this web radio working sketch that I want add to it a function to retrieve weather temperature from OpenWeatherMap.
Independently both sketches are working.
When I add to the web radio sketch #include <HTTPClient.h>
#include <ArduinoJson.h> I get compile error

Compilation error: Audio.h: No such file or directory

here is the web radio working sketch:

//ESP32 Internet Radio
//Importat Note:  The following sketches require version 3.4.1 of the library ESP32-audioI2S.
//Please select version 3.4.1 in the library manager.
#include <Wire.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>

#include <Arduino.h>
#include <AudioAnalyzer.h>

#include <Audio.h>
#include <AiEsp32RotaryEncoder.h>
#include <Adafruit_ILI9341.h>
#include <Adafruit_GFX.h>
#include <XPT2046_Touchscreen.h>

#include <WiFiManager.h>  // https://github.com/tzapu/WiFiManager
//#include <string.h>
#include <SPI.h>
#include <AudioAnalyzer.h>
#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
//#include <FreeMonoBoldOblique18pt7b.h>
#include <Fonts/FreeSerifBold18pt7b.h>
#include <ESP32Time.h>
ESP32Time rtc(-180000);
//#include <FreeMono12pt7b.h>
Analyzer OtherAudio = Analyzer(47, 41, 10);  //Strobe pin ->47  RST pin ->41 Analog Pin ->10


int strobe = 47;  // strobe pins on digital 47
int res = 41;     // reset pins on digital 41
int FreqVal[7];   // store band values in these arrays
byte bartop[7];
byte barpeak[7];
int audio_bar_height[7];
int audio_bar_peak[7];
int i = 0;
int band;
int sens;
int test;
int num;
int data1;
int j;
int voll;
int volr;
int barlx = 10;
int barrx = 30;
int barWidth = 10;
int maxTop = 180;
int minTop = 229;
int barBottom = 230;
int currentTop;
int barx;
int basex;
int vol;
int diff;
char temp[50];
char humid[50];
unsigned long previousMillis = 0;
unsigned long interval = 60000UL;

#define I2S_DOUT 2
#define I2S_BCLK 3
#define I2S_LRC 4
//#define VOLUME_PIN 5  //Original sketch was using

#define TFT_CS 1
#define TFT_DC 9
#define TFT_RST 8
//Display LED to 3.3 V
#define TFT_MOSI 11
#define TFT_MISO 13
#define TFT_SCLK 12

// Color constants
#define BACKGROUND_COL ILI9341_WHITE
#define BAR_COL_MAIN ILI9341_GREEN
#define BAR_COL_TOP ILI9341_RED





#define TRIGGER_PIN 14  //Trigger wifi on Demand

#define ROTARY_ENCODER_A_PIN 21
#define ROTARY_ENCODER_B_PIN 20
#define ROTARY_ENCODER_BUTTON_PIN 14
#define ROTARY_ENCODER_STEPS 4

const char *ntpServer = "ca.pool.ntp.org";
const long gmtOffset_sec = -18000;    // Adjust for your timezone
const int daylightOffset_sec = 3600;  // Adjust if DST is active

int timeout = 120;     // seconds to wait for Wifi
char song[128] = "8";  //Test value until the first streaminfo kicks in

AiEsp32RotaryEncoder rotaryEncoder(ROTARY_ENCODER_A_PIN, ROTARY_ENCODER_B_PIN, ROTARY_ENCODER_BUTTON_PIN, -1, ROTARY_ENCODER_STEPS);






Audio audio;

// WiFi credentials
const char *ssid = "YOUR NETWORK";
const char *password = "YOUR PASSWORD";

// Radio stations
const char *stations[] = {
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CJFMFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CHMPFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CBMEFM_CBC.mp3",
  "http://www.byte.fm/stream/bytefm.m3u",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CKOIFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CKBEFM.mp3",
  "https://stream.rythme971.ca/chlx.mp3",
  "https://best-90s.stream.laut.fm/best-90s",
  "https://stream.zeno.fm/ygg6zypxpg8uv",
  "http://live.radiomixx.ro/"
};
const char *stationNames[] = {
  "Virgin Radio",
  "TSN 690",
  "CBC Montreal",
  "KEXP",
  "96.9CKOI",
  "The Beat 92.5",
  "Rythme971",
  "Best 90' Radio",
  "City FM Bolivia",
  "Radio MIXX Romania"
};

const int NUM_STATIONS = sizeof(stations) / sizeof(stations[0]);
int currentStation = 0;

char streamTitle[64] = "";  // Buffer to store the current stream title

// Volume control variables
const int SAMPLES = 5;
int volumeReadings[SAMPLES];
int readIndex = 0;
int total = 0;
int average = 0;
int amp = 0;
unsigned long lastVolumeCheck = 0;
const unsigned long VOLUME_CHECK_INTERVAL = 500;  // Check every 500ms
//Time and date variables
char ttime[128] = "";
char tdate[128] = "";
char tday[128] = "";

// Flags initialization
bool isWiFiConnected = false;
bool isDisplayInitialized = false;
bool isAudioInitialized = false;

void IRAM_ATTR readEncoderISR() {
  rotaryEncoder.readEncoder_ISR();
}


Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
//Screen calibration
#define TOUCH_CS 18

//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
XPT2046_Touchscreen touch(TOUCH_CS);

int xMinVal, xMaxVal, yMinVal, yMaxVal;

TS_Point waitForTouch() {
  while (!touch.touched()) {
    delay(200);
  }
  delay(200);
  TS_Point p = touch.getPoint();
  while (touch.touched());
  delay(200);
  return p;
}
Adafruit_GFX_Button btn;

bool toggleState = false;


void setup() {
  delay(1000);
  Serial.begin(115200);
  while (!Serial) { delay(10); }  // Wait for Serial to start
  Serial.println(F("ESP32-S3 Internet Radio started..."));
  isDisplayInitialized = true;
  OtherAudio.Init();  // Init audio analyzer module
  pinMode(48, OUTPUT);
  pinMode(46, INPUT);
  pinMode(15, INPUT_PULLUP);
  pinMode(16, INPUT_PULLUP);
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
  rotaryEncoder.begin();
  rotaryEncoder.setup(readEncoderISR);
  rotaryEncoder.setBoundaries(0, NUM_STATIONS - 1, true);
  rotaryEncoder.setAcceleration(0);

  SPI.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, TFT_CS);
  //Screen calibrate

  tft.begin();
  touch.begin();
  tft.setRotation(3);
  touch.setRotation(3);

  tft.fillScreen(ILI9341_BLACK);
  tft.setTextSize(2);
  tft.setTextColor(ILI9341_WHITE);

  // Ask user to touch four corners
  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 20);
  tft.fillRoundRect(10, 10, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);

  tft.println("Touch TOP-LEFT");
  TS_Point p1 = waitForTouch();
  xMinVal = p1.x;
  yMinVal = p1.y;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(300, 20);
  tft.fillRoundRect(260, 10, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);

  tft.println("Touch TOP-RIGHT");
  //tft.fillRoundRect(180, 200, 50, 50, 45, ILI9341_WHITE);
  //tft.setCursor(20, 140);

  TS_Point p2 = waitForTouch();
  xMaxVal = p2.x;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 200);
  tft.fillRoundRect(10, 180, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);
  tft.println("Touch BOTTOM-LEFT");
  TS_Point p3 = waitForTouch();
  yMaxVal = p3.y;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 140);
  tft.println("Calibration Done!");
  delay(2000);

  // Print values
  Serial.println("Calibration Values:");
  Serial.print("xMin = ");
  Serial.println(xMinVal);
  Serial.print("xMax = ");
  Serial.println(xMaxVal);
  Serial.print("yMin = ");
  Serial.println(yMinVal);
  Serial.print("yMax = ");
  Serial.println(yMaxVal);



  tft.setCursor(20, 50);

  tft.fillScreen(ILI9341_BLACK);

  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(4);
  tft.println(" Web Radio");
  delay(2000);
  tft.setCursor(50, 85);
  tft.setTextSize(3);
  tft.println("  Starting");
  delay(2000);
  tft.setTextSize(2);
  tft.fillScreen(ILI9341_BLACK);

  tft.setTextColor(ILI9341_YELLOW);
  tft.setCursor(60, 60);
  tft.setTextSize(4);
  tft.println("Display");
  delay(1000);
  tft.setTextColor(ILI9341_RED);
  tft.setCursor(20, 95);
  tft.setTextSize(4);
  tft.setTextColor(ILI9341_BLUE);
  tft.println("Initialized");
  delay(1000);
  //Start Wifi
  Serial.println(F("Starting WiFi..."));

  pinMode(TRIGGER_PIN, INPUT_PULLUP);
  while (digitalRead(TRIGGER_PIN) == HIGH) {

    tft.fillScreen(ILI9341_WHITE);

    tft.setTextColor(ILI9341_RED);
    tft.setTextSize(2);
    tft.setCursor(20, 20);
    tft.println("Press Internet button");
    delay(1000);
    tft.setCursor(40, 50);
    tft.println("Check your phone");
    delay(1000);
    tft.setCursor(50, 80);
    tft.println("Configure Wifi");
    delay(1000);
  }
  WiFiManager wm;

  //reset Wifi settings for new Wifi
  wm.resetSettings();

  // set config Web portal timeout
  wm.setConfigPortalTimeout(timeout);

  if (!wm.startConfigPortal("OnDemandAP")) {
    Serial.println("failed to connect and hit timeout");

    ESP.restart();
  }

  int attempts = 0;
  while (WiFi.status() != WL_CONNECTED && attempts < 10) {
    delay(500);
    Serial.print(".");
    attempts++;
  }
  if (WiFi.status() == WL_CONNECTED) {
    Serial.println(F("\nWiFi connected"));
    isWiFiConnected = true;
  }
  tft.fillScreen(ILI9341_RED);

  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(3);
  tft.setCursor(20, 20);
  tft.println("Wifi connected");




  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
  //
  // Initialize button: (tft, x, y, width, height, outline, fill, textcolor, label, textsize)
  btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_GREEN, ILI9341_BLACK, "MUTE", 1);
  btn.drawButton();

  initializeAudio();

}



void loop() {
  //static unsigned long lastInitAttempt = 0;
  //const unsigned long initInterval = 5000;  // 5 between

  // Basic Loop
  audio.loop();



  checkEncoder();
  readfreq();
  unsigned long currentMillis = millis();  // Get current time
  if (currentMillis - previousMillis >= interval) {
    // Save the last time you blinked the LED
    previousMillis = currentMillis;
    showtime();
  }



  yield();

  //Check MUTE
  if (touch.touched()) {
    TS_Point p = touch.getPoint();

    // Map raw touch coordinates to screen pixels (values depend on calibration)
    int x = map(p.x, 463, 3685, 0, tft.width());
    int y = map(p.y, 680, 3564, 0, tft.height());

    // Update button "pressed" state
    btn.press(btn.contains(x, y));
  } else {
    btn.press(false);
  }

  // Check for the moment the button is released to toggle the state
  if (btn.justReleased()) {
    toggleState = !toggleState;

    // Redraw button with new state colors/labels
    if (toggleState) {
      btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_GREEN, ILI9341_BLACK, "MUTE", 1);
    } else {
      btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_RED, ILI9341_WHITE, "UNMUTE", 1);
    }
    btn.drawButton();

    // Perform action (e.g., turn on an LED)
    digitalWrite(LED_BUILTIN, toggleState ? HIGH : LOW);
  }
}




void initializeDisplay() {
  Serial.println(F("InitializingILI9341 Display..."));


  tft.fillScreen(ILI9341_WHITE);
  tft.setTextSize(2);
  tft.setTextColor(ILI9341_GREEN);
  tft.setCursor(20, 40);
  tft.println(F("Initializing..."));
  delay(1000);

  isDisplayInitialized = true;
  Serial.println(F("Display initialized"));
}





void initializeAudio() {
  audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
  audio.setVolume(10);
  connectToStation(currentStation);
  isAudioInitialized = true;
  Serial.println(F("Audio initialized"));
}

void checkEncoder() {
  if (rotaryEncoder.encoderChanged()) {
    //Serial.println("Changing..");
    currentStation = rotaryEncoder.readEncoder();
    connectToStation(currentStation);
  }

  if (rotaryEncoder.isEncoderButtonClicked()) {
    Serial.println(F("Encoder-SW check"));
    // Here other funtion using the SW, it is used to trigger Wifi setup, OnDemand
  }
}

void connectToStation(int stationIndex) {
  audio.stopSong();
  audio.connecttohost(stations[stationIndex]);
  updateDisplay();
}



void updateDisplay() {
  if (!isDisplayInitialized) return;




  //if (isDisplayInitialized && isWiFiConnected && isAudioInitialized) {
  //showtime();
  //}
  
  tft.fillScreen(ILI9341_WHITE);

  tft.setTextColor(ILI9341_BLACK);
  tft.setCursor(5, 10);

  tft.setTextSize(1);
  tft.setFont(&FreeSans9pt7b);
  tft.println("Station...       ");
  tft.setTextColor(ILI9341_RED);
  //tft.print(String(stationNames[currentStation]) );


  //tft.print(String(stationNames[currentStation])  );
  tft.setTextColor(ILI9341_RED);
  tft.setFont(&FreeSans9pt7b);
  tft.setCursor(80, 10);
  tft.print((String(stationNames[currentStation])));

  //tft.println();

  tft.setCursor(5, 30);
  tft.setTextSize(1);

  tft.setTextColor(ILI9341_BLACK);
  tft.println("Playing  ");
  tft.setTextColor(ILI9341_RED);
  tft.setCursor(80, 30);
  tft.print((String(streamTitle)));


  /*  tft.setFont(&FreeMonoBoldOblique12pt7b);

  tft.setCursor(100, 75);
  tft.setTextSize(1);
  tft.setTextColor(ILI9341_BLUE);
  tft.println(tday);

  tft.setCursor(65, 92);
  tft.setTextSize(1);
  tft.setTextColor(ILI9341_BLUE);
  tft.println(tdate);
  tft.setCursor(110, 120);
  tft.setTextSize(1);
  tft.setTextColor(ILI9341_BLUE);
  tft.setFont(&FreeSerifBold18pt7b);
  tft.println(ttime);
  */
  tft.setCursor(5, 90);
  tft.setFont();
  tft.setTextColor(ILI9341_BLACK);
  tft.println("VOLUME");
  tft.setCursor(10, 95);
  tft.println("L");
  tft.setCursor(30, 95);
  tft.println("R");

  tft.setTextColor(ILI9341_BLACK);
  tft.setTextSize(1);
  //tft.setFont(FreeMono12pt7b.h);
  tft.setFont();
  tft.setCursor(80, 230);
  tft.println("64");
  tft.setCursor(100, 230);
  tft.println("160");
  tft.setCursor(125, 230);
  tft.println("400");
  tft.setCursor(150, 230);
  tft.println("1K ");
  tft.setCursor(170, 230);
  tft.println("2.5K");
  tft.setCursor(200, 230);
  tft.println("6.3K");
  tft.setCursor(230, 230);
  tft.println("16K");

  tft.setCursor(250, 140);
  tft.setTextSize(1);
  tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
  sprintf(temp, "Temp %d C", 45);
  tft.println(temp);
  tft.setCursor(250, 180);
  tft.setTextSize(1);
  tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
  sprintf(humid, "Humid %d%%", 80);
  tft.println(humid);
  showtime();

  volume(voll, volr);
  basex = 10;
  vol = voll;
  drawBar(basex, vol);
  delay(50);
  basex = 30;
  vol = volr;
  drawBar(basex, vol);
  btn.drawButton();

  /*tft.fillRect(volbarlx, volbasey-maxheight,10, maxheight-voll-40,ILI9341_WHITE);
    tft.fillRect(volbarlx, volbasey-voll, 10, voll, ILI9341_GREEN);
    Serial.println(voll);
    delay(3000);
    tft.fillRect(volbarrx, volbasey-maxheight,10, maxheight-volr-40,ILI9341_WHITE);
    tft.fillRect(volbarrx, volbasey-volr, 10, volr, ILI9341_GREEN);
    
    delay(50);*/
}

// Audio callback functions
void audio_info(const char *info) {
  Serial.print("info        ");
  Serial.println(info);
}
void audio_id3data(const char *info) {
  Serial.print("id3data     ");
  Serial.println(info);
}
void audio_eof_mp3(const char *info) {
  Serial.print("eof_mp3     ");
  Serial.println(info);
}
void audio_showstation(const char *info) {
  Serial.print("station     ");
  Serial.println(info);
}
void audio_showstreaminfo(const char *info) {
  Serial.print("streaminfo  ");
  Serial.println(info);
}
void audio_showstreamtitle(const char *info) {
  Serial.print("streamtitle: ");
  Serial.println(info);

  streamTitle[sizeof(streamTitle) - 1] = '\0';  // Ensure null-termination
  strncpy(streamTitle, info, sizeof(streamTitle) - 1);
  updateDisplay();
}
void audio_bitrate(const char *info) {
  Serial.print("bitrate     ");
  Serial.println(info);
}
void audio_commercial(const char *info) {
  Serial.print("commercial  ");
  Serial.println(info);
}
void audio_icyurl(const char *info) {
  Serial.print("icyurl      ");
  Serial.println(info);
}
void audio_lasthost(const char *info) {
  Serial.print("lasthost    ");
  Serial.println(info);
}
void audio_eof_speech(const char *info) {
  Serial.print("eof_speech  ");
  Serial.println(info);
}
void showtime() {
  struct tm timeinfo = rtc.getTimeStruct();
  if (!getLocalTime(&timeinfo)) {
    Serial.println("Failed to obtain time");
    return;
  }
  Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");
  //delay(1000);
  strftime(tdate, 128, "%B %d %Y", &timeinfo);
  strftime(ttime, 128, "%H:%M", &timeinfo);
  strftime(tday, 128, "%A", &timeinfo);
  //Display time & date
  //tft.setFont(&FreeMonoBoldOblique12pt7b);
  tft.setFont();
  tft.setCursor(82, 50);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.print(" ");
  tft.print(tday);
  tft.print(" ");
  tft.setCursor(65, 77);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.println(tdate);
  tft.setCursor(110, 105);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_WHITE, ILI9341_WHITE);
  //tft.setFont(&FreeSerifBold18pt7b);
  tft.println(ttime);
  tft.setCursor(115, 105);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.println(ttime);
}
void volume(int &voll, int &volr) {
  voll = analogRead(15);
  volr = analogRead(16);
  voll = 640;
  volr = 640;
  voll = map(voll, 10, 1023, 20, 512);
  volr = map(volr, 10, 1023, 20, 512);
}

void readfreq() {


  OtherAudio.ReadFreq(FreqVal);  //Return 7 values of 7 bands pass filter
                                 //Frequency(Hz):63  160  400  1K  2.5K  6.25K  16K
                                 //FreqVal[]:      0    1    2    3    4    5    6




  for (int i = 0; i < 7; i++) {  // loop for every frequency (63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz)


    test = FreqVal[i] - 100;
    //Serial.printf("FreqVal %d : %d\n",i,FreqVal[i]); //view each frequency level
    audio_bar_height[i] = map(max(test, 0), 0, 4095, 0, 64);  // set the bar value based on the measurement from the audio analyzer sensor

    // calculate the peak position
    if (audio_bar_peak[i] < audio_bar_height[i]) {         // if the peak is below the current bar size
      audio_bar_peak[i] = audio_bar_height[i];             // move peak to the new max. position (i.e. size of the bar)
    } else if (audio_bar_peak[i] > audio_bar_height[i]) {  // if the bar is lower than the peak
      audio_bar_peak[i]--;                                 // slowly move the peak down, one pixel every frame
    }

    tft.fillRect(80 + i * 25, 140, 5, 63, ILI9341_RED);

    tft.fillRect(80 + i * 25, 220 - audio_bar_height[i], 5, audio_bar_height[i], ILI9341_BLACK);  //draw bar

    tft.fillRect(80 + i * 25, 220 - audio_bar_peak[i], 5, 1, ILI9341_BLACK);  // draw peak

    /*volume (voll, volr);
        

    

    tft.fillRect(volbarlx, volbasey-maxheight,10, voll,ILI9341_WHITE);
    tft.fillRect(volbarrx, volbasey-maxheight,10, volr,ILI9341_WHITE);
    tft.fillRect(volbarlx, 200-voll, 10, voll, ILI9341_GREEN);
    tft.fillRect(volbarrx, 200-volr, 10, volr, ILI9341_GREEN);
    delay(50);
*/
  }
}


void drawBar(int &basex, int &vol) {
  // Variables
  int sensorValue = vol;
  int barWidth = 8;
  int maxBarHeight = 110;
  int yBase = 230;  // The screen Y-coordinate for the bottom of the bar
  int triggerValue = 90;
  uint16_t barColor;
  // 1. Map your sensor value to a pixel height
  int currentHeight = map(sensorValue, 0, 384, 0, maxBarHeight);

  // 2. Select color based on trigger value
  //uint16_t barColor = (currentHeight > triggerValue) ? ILI9341_RED : ILI9341_GREEN;

  // 3. Clear previous bar (optional but recommended to prevent ghosting)
  tft.fillRect(basex, yBase - maxBarHeight, barWidth, maxBarHeight, ILI9341_WHITE);
  if (currentHeight > triggerValue) {
    diff = currentHeight - triggerValue;
    barColor = ILI9341_RED;
    tft.fillRect(basex, yBase - maxBarHeight - diff, barWidth, maxBarHeight, ILI9341_RED);
  }
  tft.fillRect(basex, yBase - currentHeight, barWidth, currentHeight, ILI9341_GREEN);
  // 4. Draw the bar from bottom up
  // Formula: tft.fillRect(x, yBase - currentHeight, width, currentHeight, color)
  //tft.fillRect(basex, yBase - currentHeight, barWidth, currentHeight, barColor);
}

Is that code working? It already includes #include <HTTPClient.h> and #include <ArduinoJson.h>

Doesn't this contradict the following statement?

How about an otherwise-empty sketch, but with the #include statements? This worked for me

#include <Wire.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <Audio.h>

void setup() {}

void loop() {}

Make a copy of what you have, with just the twenty #include, and empty setup and loop

If that works, start putting code back.

(BTW, you don't need <Arduino.h> in an .ino -- it's "silently" tacked on at the top automatically when compiling. Also, you have <AudioAnalyzer.h> twice.)

Without [quote="embeddedkiddie, post:3, topic:1447027"]
#include <HTTPClient.h> and #include <ArduinoJson.h>
[/quote]

it is working.

@kenb4
Your suggestion worked, no more compile errors.
Just that now, after adding all the code and uploading the display shows nothing and the serial monitor gives the following message:
Build:Mar 27 2021

rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT)

SPIWP:0xee

mode:DIO, clock div:1

load:0x3fce2820,len:0x10cc

load:0x403c8700,len:0xc2c

load:0x403cb700,len:0x30c0

entry 0x403c88b8

This message is most likely to appear when the ESP32S3 starts up or resets. If the message appears repeatedly, there may be an error causing the reset.

How about breaking down the sketch into smaller sections and testing them step by step?

At the very least, it's better to add functionality step by step, ensuring you create a working sketch, rather than trying to code everything at once.

Sorry but since I don't have the same board or components as you have, it's difficult for me to debug the code in post #2, for example, in my head.

I have one thought.

Web radio programs likely run on core 0, to get mp3 streaming data over the internet.
I'm not sure if it's possible to access OpenWeatherMap on core 1 at the same time.

I'd like to hear the opinion of someone with expertise.

Unless you go out of your way to spool up FreeRTOS tasks on Core 0, most "Arduino-Like" code runs on Core 1. The ESP32 audio library handling the web radio may indeed do this and run tasks on Core 0. Arduino setup() and loop() functions run in a Core 1 task spooled up by main.cpp. All functions called by those two function would also be running on Core 1 (again, unless they launch tasks on Core 0). Does OpenWeatherMap run on other processors besides ESP32? If so, I'd guess it doesn't have ESP32-specific code to run on Core 0. Thus, in all likelihood, it's running on Core 1 already.

It works now, I had to change USB CDC on Boot to disabled.

Here is the full code:

//ESP32 Internet Radio
//Importat Note:  The following sketches require version 3.4.1 of the library ESP32-audioI2S.
//Please select version 3.4.1 in the library manager.
#include <Wire.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>

//#include <Arduino.h>
#include <AudioAnalyzer.h>

#include <Audio.h>
#include <AiEsp32RotaryEncoder.h>
#include <Adafruit_ILI9341.h>
#include <Adafruit_GFX.h>
#include <XPT2046_Touchscreen.h>

#include <WiFiManager.h>  // https://github.com/tzapu/WiFiManager

#include <SPI.h>

#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
//#include <FreeMonoBoldOblique18pt7b.h>
#include <Fonts/FreeSerifBold18pt7b.h>
#include <ESP32Time.h>

ESP32Time rtc(-180000);

Analyzer OtherAudio = Analyzer(47, 41, 10);  //Strobe pin ->47  RST pin ->41 Analog Pin ->10


int strobe = 47;  // strobe pins on digital 47
int res = 41;     // reset pins on digital 41
int FreqVal[7];   // store band values in these arrays
byte bartop[7];
byte barpeak[7];
int audio_bar_height[7];
int audio_bar_peak[7];
int i = 0;
int band;
int sens;
int test;
int num;
int data1;
int j;
int voll;
int volr;
int barlx = 10;
int barrx = 30;
int barWidth = 10;
int maxTop = 180;
int minTop = 229;
int barBottom = 230;
int currentTop;
int barx;
int basex;
int vol;
int diff;

unsigned long previousMillis = 0;
unsigned long interval = 60000UL;

#define I2S_DOUT 2
#define I2S_BCLK 3
#define I2S_LRC 4


#define TFT_CS 1
#define TFT_DC 9
#define TFT_RST 8
//Display LED to 3.3 V
#define TFT_MOSI 11
#define TFT_MISO 13
#define TFT_SCLK 12

// Color constants
#define BACKGROUND_COL ILI9341_WHITE
#define BAR_COL_MAIN ILI9341_GREEN
#define BAR_COL_TOP ILI9341_RED





#define TRIGGER_PIN 14  //Trigger wifi on Demand

#define ROTARY_ENCODER_A_PIN 21
#define ROTARY_ENCODER_B_PIN 20
#define ROTARY_ENCODER_BUTTON_PIN 14
#define ROTARY_ENCODER_STEPS 4

const char *ntpServer = "ca.pool.ntp.org";
const long gmtOffset_sec = -18000;    // Adjust for your timezone
const int daylightOffset_sec = 3600;  // Adjust if DST is active

int timeout = 120;     // seconds to wait for Wifi
char song[128] = "8";  //Test value until the first streaminfo kicks in

AiEsp32RotaryEncoder rotaryEncoder(ROTARY_ENCODER_A_PIN, ROTARY_ENCODER_B_PIN, ROTARY_ENCODER_BUTTON_PIN, -1, ROTARY_ENCODER_STEPS);






Audio audio;

// WiFi credentials
const char *ssid = "YOUR NETWORK";
const char *password = "YOUR PASSWORD";

// Radio stations
const char *stations[] = {
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CJFMFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CHMPFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CBMEFM_CBC.mp3",
  "http://www.byte.fm/stream/bytefm.m3u",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CKOIFM.mp3",
  "https://playerservices.streamtheworld.com/api/livestream-redirect/CKBEFM.mp3",
  "https://stream.rythme971.ca/chlx.mp3",
  "https://best-90s.stream.laut.fm/best-90s",
  "https://stream.zeno.fm/ygg6zypxpg8uv",
  "http://live.radiomixx.ro/"
};
const char *stationNames[] = {
  "Virgin Radio",
  "TSN 690",
  "CBC Montreal",
  "KEXP",
  "96.9CKOI",
  "The Beat 92.5",
  "Rythme971",
  "Best 90' Radio",
  "City FM Bolivia",
  "Radio MIXX Romania"
};

const int NUM_STATIONS = sizeof(stations) / sizeof(stations[0]);
int currentStation = 0;

char streamTitle[64] = "";  // Buffer to store the current stream title

// Volume control variables
const int SAMPLES = 5;
int volumeReadings[SAMPLES];
int readIndex = 0;
int total = 0;
int average = 0;
int amp = 0;
unsigned long lastVolumeCheck = 0;
const unsigned long VOLUME_CHECK_INTERVAL = 500;  // Check every 500ms
//Time and date variables
char ttime[128] = "";
char tdate[128] = "";
char tday[128] = "";

// Flags initialization
bool isWiFiConnected = false;
bool isDisplayInitialized = false;
bool isAudioInitialized = false;

void IRAM_ATTR readEncoderISR() {
  rotaryEncoder.readEncoder_ISR();
}


Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
//Screen calibration
#define TOUCH_CS 18


XPT2046_Touchscreen touch(TOUCH_CS);

int xMinVal, xMaxVal, yMinVal, yMaxVal;

TS_Point waitForTouch() {
  while (!touch.touched()) {
    delay(200);
  }
  delay(200);
  TS_Point p = touch.getPoint();
  while (touch.touched())
    ;
  delay(200);
  return p;
}
Adafruit_GFX_Button btn;

bool toggleState = false;


void setup() {
  delay(1000);
  Serial.begin(115200);
  while (!Serial) { delay(10); }  // Wait for Serial to start
  Serial.println(F("ESP32-S3 Internet Radio started..."));
  isDisplayInitialized = true;
  OtherAudio.Init();  // Init audio analyzer module
  pinMode(48, OUTPUT);
  pinMode(46, INPUT);
  pinMode(15, INPUT_PULLUP);
  pinMode(16, INPUT_PULLUP);
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
  rotaryEncoder.begin();
  rotaryEncoder.setup(readEncoderISR);
  rotaryEncoder.setBoundaries(0, NUM_STATIONS - 1, true);
  rotaryEncoder.setAcceleration(0);

  SPI.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, TFT_CS);
  //Screen calibrate

  tft.begin();
  touch.begin();
  tft.setRotation(3);
  touch.setRotation(3);

  tft.fillScreen(ILI9341_BLACK);
  tft.setTextSize(2);
  tft.setTextColor(ILI9341_WHITE);

  // Ask user to touch four corners
  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 20);
  tft.fillRoundRect(10, 10, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);

  tft.println("Touch TOP-LEFT");
  TS_Point p1 = waitForTouch();
  xMinVal = p1.x;
  yMinVal = p1.y;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(300, 20);
  tft.fillRoundRect(260, 10, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);

  tft.println("Touch TOP-RIGHT");

  TS_Point p2 = waitForTouch();
  xMaxVal = p2.x;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 200);
  tft.fillRoundRect(10, 180, 50, 50, 45, ILI9341_WHITE);
  tft.setCursor(40, 140);
  tft.println("Touch BOTTOM-LEFT");
  TS_Point p3 = waitForTouch();
  yMaxVal = p3.y;

  tft.fillScreen(ILI9341_BLACK);
  tft.setCursor(20, 140);
  tft.println("Calibration Done!");
  delay(2000);

  // Print values
  Serial.println("Calibration Values:");
  Serial.print("xMin = ");
  Serial.println(xMinVal);
  Serial.print("xMax = ");
  Serial.println(xMaxVal);
  Serial.print("yMin = ");
  Serial.println(yMinVal);
  Serial.print("yMax = ");
  Serial.println(yMaxVal);



  tft.setCursor(20, 50);

  tft.fillScreen(ILI9341_BLACK);

  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(4);
  tft.println(" Web Radio");
  delay(2000);
  tft.setCursor(50, 85);
  tft.setTextSize(3);
  tft.println("  Starting");
  delay(2000);
  tft.setTextSize(2);
  tft.fillScreen(ILI9341_BLACK);

  tft.setTextColor(ILI9341_YELLOW);
  tft.setCursor(60, 60);
  tft.setTextSize(4);
  tft.println("Display");
  delay(1000);
  tft.setTextColor(ILI9341_RED);
  tft.setCursor(20, 95);
  tft.setTextSize(4);
  tft.setTextColor(ILI9341_BLUE);
  tft.println("Initialized");
  delay(1000);
  //Start Wifi
  Serial.println(F("Starting WiFi..."));

  pinMode(TRIGGER_PIN, INPUT_PULLUP);
  while (digitalRead(TRIGGER_PIN) == HIGH) {

    tft.fillScreen(ILI9341_WHITE);

    tft.setTextColor(ILI9341_RED);
    tft.setTextSize(2);
    tft.setCursor(20, 20);
    tft.println("Press Internet button");
    delay(1000);
    tft.setCursor(40, 50);
    tft.println("Check your phone");
    delay(1000);
    tft.setCursor(50, 80);
    tft.println("Configure Wifi");
    delay(1000);
  }
  WiFiManager wm;

  //reset Wifi settings for new Wifi
  wm.resetSettings();

  // set config Web portal timeout
  wm.setConfigPortalTimeout(timeout);

  if (!wm.startConfigPortal("OnDemandAP")) {
    Serial.println("failed to connect and hit timeout");

    ESP.restart();
  }

  int attempts = 0;
  while (WiFi.status() != WL_CONNECTED && attempts < 10) {
    delay(500);
    Serial.print(".");
    attempts++;
  }
  if (WiFi.status() == WL_CONNECTED) {
    Serial.println(F("\nWiFi connected"));
    isWiFiConnected = true;
  }
  tft.fillScreen(ILI9341_RED);

  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(3);
  tft.setCursor(20, 20);
  tft.println("Wifi connected");




  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);

  btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_GREEN, ILI9341_BLACK, "MUTE", 1);
  btn.drawButton();

  initializeAudio();
}



void loop() {
  //static unsigned long lastInitAttempt = 0;
  //const unsigned long initInterval = 5000;  // 5 between

  // Basic Loop
  audio.loop();



  checkEncoder();
  readfreq();
  unsigned long currentMillis = millis();  // Get current time
  if (currentMillis - previousMillis >= interval) {
    // Save the last time you blinked the LED
    previousMillis = currentMillis;
    showtime();
  }



  yield();

  //Check MUTE
  if (touch.touched()) {
    TS_Point p = touch.getPoint();

    // Map raw touch coordinates to screen pixels (values depend on calibration)
    int x = map(p.x, 463, 3685, 0, tft.width());
    int y = map(p.y, 680, 3564, 0, tft.height());

    // Update button "pressed" state
    btn.press(btn.contains(x, y));
  } else {
    btn.press(false);
  }

  // Check for the moment the button is released to toggle the state
  if (btn.justReleased()) {
    toggleState = !toggleState;

    // Redraw button with new state colors/labels
    if (toggleState) {
      btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_GREEN, ILI9341_BLACK, "MUTE", 1);
    } else {
      btn.initButton(&tft, 60, 230, 40, 40, ILI9341_WHITE, ILI9341_RED, ILI9341_WHITE, "UNMUTE", 1);
    }
    btn.drawButton();

    // Perform action (e.g., turn on an LED)
    digitalWrite(LED_BUILTIN, toggleState ? HIGH : LOW);
  }
}




void initializeDisplay() {
  Serial.println(F("InitializingILI9341 Display..."));


  tft.fillScreen(ILI9341_WHITE);
  tft.setTextSize(2);
  tft.setTextColor(ILI9341_GREEN);
  tft.setCursor(20, 40);
  tft.println(F("Initializing..."));
  delay(1000);

  isDisplayInitialized = true;
  Serial.println(F("Display initialized"));
}





void initializeAudio() {
  audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
  audio.setVolume(10);
  connectToStation(currentStation);
  isAudioInitialized = true;
  Serial.println(F("Audio initialized"));
}

void checkEncoder() {
  if (rotaryEncoder.encoderChanged()) {

    currentStation = rotaryEncoder.readEncoder();
    connectToStation(currentStation);
  }

  if (rotaryEncoder.isEncoderButtonClicked()) {
    Serial.println(F("Encoder-SW check"));
    // Here other funtion using the SW, it is used to trigger Wifi setup, OnDemand
  }
}

void connectToStation(int stationIndex) {
  audio.stopSong();
  audio.connecttohost(stations[stationIndex]);
  updateDisplay();
}



void updateDisplay() {
  if (!isDisplayInitialized) return;






  tft.fillScreen(ILI9341_WHITE);

  tft.setTextColor(ILI9341_BLACK);
  tft.setCursor(5, 10);

  tft.setTextSize(1);
  tft.setFont(&FreeSans9pt7b);
  tft.println("Station...       ");
  tft.setTextColor(ILI9341_RED);



  //tft.print(String(stationNames[currentStation])  );
  tft.setTextColor(ILI9341_RED);
  tft.setFont(&FreeSans9pt7b);
  tft.setCursor(80, 10);
  tft.print((String(stationNames[currentStation])));


  tft.setCursor(5, 30);
  tft.setTextSize(1);

  tft.setTextColor(ILI9341_BLACK);
  tft.println("Playing  ");
  tft.setTextColor(ILI9341_RED);
  tft.setCursor(80, 30);
  tft.print((String(streamTitle)));



  tft.setCursor(5, 90);
  tft.setFont();
  tft.setTextColor(ILI9341_BLACK);
  tft.println("VOLUME");
  tft.setCursor(10, 95);
  tft.println("L");
  tft.setCursor(30, 95);
  tft.println("R");

  tft.setTextColor(ILI9341_BLACK);
  tft.setTextSize(1);

  tft.setFont();
  tft.setCursor(80, 230);
  tft.println("64");
  tft.setCursor(100, 230);
  tft.println("160");
  tft.setCursor(125, 230);
  tft.println("400");
  tft.setCursor(150, 230);
  tft.println("1K ");
  tft.setCursor(170, 230);
  tft.println("2.5K");
  tft.setCursor(200, 230);
  tft.println("6.3K");
  tft.setCursor(230, 230);
  tft.println("16K");


  showtime();

  volume(voll, volr);
  basex = 10;
  vol = voll;
  drawBar(basex, vol);
  delay(50);
  basex = 30;
  vol = volr;
  drawBar(basex, vol);
  btn.drawButton();
  temperature();
}

// Audio callback functions
void audio_info(const char *info) {
  Serial.print("info        ");
  Serial.println(info);
}
void audio_id3data(const char *info) {
  Serial.print("id3data     ");
  Serial.println(info);
}
void audio_eof_mp3(const char *info) {
  Serial.print("eof_mp3     ");
  Serial.println(info);
}
void audio_showstation(const char *info) {
  Serial.print("station     ");
  Serial.println(info);
}
void audio_showstreaminfo(const char *info) {
  Serial.print("streaminfo  ");
  Serial.println(info);
}
void audio_showstreamtitle(const char *info) {
  Serial.print("streamtitle: ");
  Serial.println(info);

  streamTitle[sizeof(streamTitle) - 1] = '\0';  // Ensure null-termination
  strncpy(streamTitle, info, sizeof(streamTitle) - 1);
  updateDisplay();
}
void audio_bitrate(const char *info) {
  Serial.print("bitrate     ");
  Serial.println(info);
}
void audio_commercial(const char *info) {
  Serial.print("commercial  ");
  Serial.println(info);
}
void audio_icyurl(const char *info) {
  Serial.print("icyurl      ");
  Serial.println(info);
}
void audio_lasthost(const char *info) {
  Serial.print("lasthost    ");
  Serial.println(info);
}
void audio_eof_speech(const char *info) {
  Serial.print("eof_speech  ");
  Serial.println(info);
}
void showtime() {
  struct tm timeinfo = rtc.getTimeStruct();
  if (!getLocalTime(&timeinfo)) {
    Serial.println("Failed to obtain time");
    return;
  }
  Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");
  //delay(1000);
  strftime(tdate, 128, "%B %d %Y", &timeinfo);
  strftime(ttime, 128, "%H:%M", &timeinfo);
  strftime(tday, 128, "%A", &timeinfo);
  //Display time & date

  tft.setFont();
  tft.setCursor(82, 50);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.print(" ");
  tft.print(tday);
  tft.print(" ");
  tft.setCursor(65, 77);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.println(tdate);
  tft.setCursor(110, 105);
  tft.setTextSize(3);
  tft.setTextColor(ILI9341_WHITE, ILI9341_WHITE);

  tft.println(ttime);
  tft.setCursor(115, 105);
  tft.setTextColor(ILI9341_BLUE, ILI9341_WHITE);
  tft.println(ttime);
}
void volume(int &voll, int &volr) {
  voll = analogRead(15);
  volr = analogRead(16);
  voll = 640;
  volr = 640;
  voll = map(voll, 10, 1023, 20, 512);
  volr = map(volr, 10, 1023, 20, 512);
}

void readfreq() {


  OtherAudio.ReadFreq(FreqVal);  //Return 7 values of 7 bands pass filter
                                 //Frequency(Hz):63  160  400  1K  2.5K  6.25K  16K
                                 //FreqVal[]:      0    1    2    3    4    5    6




  for (int i = 0; i < 7; i++) {  // loop for every frequency (63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz)


    test = FreqVal[i] - 100;
    //Serial.printf("FreqVal %d : %d\n",i,FreqVal[i]); //view each frequency level
    audio_bar_height[i] = map(max(test, 0), 0, 4095, 0, 64);  // set the bar value based on the measurement from the audio analyzer sensor

    // calculate the peak position
    if (audio_bar_peak[i] < audio_bar_height[i]) {         // if the peak is below the current bar size
      audio_bar_peak[i] = audio_bar_height[i];             // move peak to the new max. position (i.e. size of the bar)
    } else if (audio_bar_peak[i] > audio_bar_height[i]) {  // if the bar is lower than the peak
      audio_bar_peak[i]--;                                 // slowly move the peak down, one pixel every frame
    }

    tft.fillRect(80 + i * 25, 140, 5, 63, ILI9341_RED);

    tft.fillRect(80 + i * 25, 220 - audio_bar_height[i], 5, audio_bar_height[i], ILI9341_BLACK);  //draw bar

    tft.fillRect(80 + i * 25, 220 - audio_bar_peak[i], 5, 1, ILI9341_BLACK);  // draw peak
  }
}


void drawBar(int &basex, int &vol) {
  // Variables
  int sensorValue = vol;
  int barWidth = 8;
  int maxBarHeight = 110;
  int yBase = 230;  // The screen Y-coordinate for the bottom of the bar
  int triggerValue = 90;
  uint16_t barColor;
  // 1. Map your sensor value to a pixel height
  int currentHeight = map(sensorValue, 0, 384, 0, maxBarHeight);

  // 2. Select color based on trigger value
  //uint16_t barColor = (currentHeight > triggerValue) ? ILI9341_RED : ILI9341_GREEN;

  // 3. Clear previous bar (optional but recommended to prevent ghosting)
  tft.fillRect(basex, yBase - maxBarHeight, barWidth, maxBarHeight, ILI9341_WHITE);
  if (currentHeight > triggerValue) {
    diff = currentHeight - triggerValue;
    barColor = ILI9341_RED;
    tft.fillRect(basex, yBase - maxBarHeight - diff, barWidth, maxBarHeight, ILI9341_RED);
  }
  tft.fillRect(basex, yBase - currentHeight, barWidth, currentHeight, ILI9341_GREEN);
  // 4. Draw the bar from bottom up
  // Formula: tft.fillRect(x, yBase - currentHeight, width, currentHeight, color)
  //tft.fillRect(basex, yBase - currentHeight, barWidth, currentHeight, barColor);
}
void temperature() {
  HTTPClient http;
  String city = "HOME";
  // Construct the API request URL
  //String serverPath = "http://openweathermap.org" + city + "," + countryCode + "&appid=" + apiKey + "&units=metric";
  String serverPath = "http://api.openweathermap.org/data/2.5/weather?q=Brossard,CA&appid=APIKEY&units=metric";
  http.begin(serverPath.c_str());
  int httpResponseCode = http.GET();
  //Serial.println("1");

  if (httpResponseCode > 0) {
    String payload = http.getString();
    //Serial.println("2");
    // Parse the JSON response
    DynamicJsonDocument doc(1024);
    deserializeJson(doc, payload);
    //Serial.println("3");
    float temp = doc["main"]["temp"];

    Serial.print("Current outdoor temperature in ");
    Serial.print(city);
    Serial.print(": ");
    Serial.print(temp);
    Serial.println(" °C");
    tft.setCursor(245, 150);
    tft.setTextSize(2);
    tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
    //sprintf(temp, "Temp %d C");
    tft.println("Temp C");
    //tft.writeln(0xF7);
    //tft.println("C");
    tft.setCursor(245, 170);
    tft.println(temp);
  } else {
    Serial.print("Error code: ");
    Serial.println(httpResponseCode);
  }
  http.end();
}

Thank you everybody!!!

@kenb4
Can you, please, explain why working with new empty sketch, adding all the include first, worked?

It may not be that specifically. First, do you have the old sketch saved, and it still fails?

If so, in the Preferences/Settings, turn on Show verbose output during compile. Then create a new sketch, copy&paste over the .ino into the new one, and build it.

If at least one fails, right-click on the Output and Copy All. Paste it here as <CODE/>. If one works, paste that too separately so we all can look for differences.

If the broken build is "no longer reproducible", then it might be some glitch in the temporary build files.

Just presenting the facts.
On the original web radio sketch I had on top a comment about the required version of the ESP32-AudioI2S. When you advice to start fresh with just adding only the #includes I did not copy the comment. I followed your advices adding only the #includes, no error, after I added the the rest of the web radio sketch (tested, working), followed by the weather sketch part. All working. Later, I added the comment and the error came back, I removed the comment and all working.
Here is the comment:

//ESP32 Internet Radio
//Important Note:  The following sketches require version 3.4.1 of the library ESP32-audioI2S.
//Please select version 3.4.1 in the library manager.