I have tried this but audio is not playing
http.begin(tts.c_str());
// Send HTTP GET request
int httpResponseCode = http.GET();
if (httpResponseCode>0) {
Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);
int len = http.getSize();
uint8_t buff[len] = {0};
WiFiClient *stream = http.getStreamPtr();
while(http.connected() && (len > 0 || len == -1)) {
size_t size = stream->available();
if(size) {
int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));
}
delay(1);
}
File file = SPIFFS.open("/helloworld.mp3", "w");
file.write(buff, len);
file.close();
}
else {
Serial.print("Error code: ");
Serial.println(httpResponseCode);
}
http.end();