|
3 | 3 | audio.cpp |
4 | 4 |
|
5 | 5 | Created on: Oct 28.2018 */char audioI2SVers[] ="\ |
6 | | - Version 3.4.1k "; |
7 | | -/* Updated on: Aug 17.2025 |
| 6 | + Version 3.4.1l "; |
| 7 | +/* Updated on: Aug 18.2025 |
8 | 8 |
|
9 | 9 | Author: Wolle (schreibfaul1) |
10 | 10 | Audio library for ESP32, ESP32-S3 or ESP32-P4 |
@@ -365,7 +365,7 @@ void Audio::setDefaults() { |
365 | 365 | m_hashQueue.shrink_to_fit(); // uint32_t vector |
366 | 366 | client.stop(); |
367 | 367 | clientsecure.stop(); |
368 | | - m_client = static_cast<WiFiClient*>(&client); /* default to *something* so that no NULL deref can happen */ |
| 368 | + m_client = static_cast<NetworkClient*>(&client); /* default to *something* so that no NULL deref can happen */ |
369 | 369 | ts_parsePacket(0, 0, 0); // reset ts routine |
370 | 370 | m_lastM3U8host.reset(); |
371 | 371 |
|
@@ -542,7 +542,7 @@ bool Audio::openai_speech(const String& api_key, const String& model, const Stri |
542 | 542 |
|
543 | 543 | bool res = true; |
544 | 544 | int port = 443; |
545 | | - m_client = static_cast<WiFiClient*>(&clientsecure); |
| 545 | + m_client = static_cast<NetworkClientSecure*>(&clientsecure); |
546 | 546 |
|
547 | 547 | uint32_t t = millis(); |
548 | 548 | AUDIO_INFO("Connect to: \"%s\"", host.get()); |
@@ -702,8 +702,8 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) { |
702 | 702 | rqh.append("Accept-Encoding: identity;q=1,*;q=0\r\n"); |
703 | 703 | rqh.append("Connection: keep-alive\r\n\r\n"); |
704 | 704 |
|
705 | | - if(m_f_ssl) { m_client = static_cast<WiFiClient*>(&clientsecure); if(port == 80) port = 443;} |
706 | | - else { m_client = static_cast<WiFiClient*>(&client); } |
| 705 | + if(m_f_ssl) { m_client = static_cast<NetworkClientSecure*>(&clientsecure); if(port == 80) port = 443;} |
| 706 | + else { m_client = static_cast<NetworkClient*>(&client); } |
707 | 707 |
|
708 | 708 | timestamp = millis(); |
709 | 709 | m_client->setTimeout(m_f_ssl ? m_timeout_ms_ssl : m_timeout_ms); |
@@ -817,8 +817,8 @@ bool Audio::httpPrint(const char* host) { |
817 | 817 | if(m_client->connected()) m_client->stop(); |
818 | 818 | } |
819 | 819 | if(!m_client->connected() ) { |
820 | | - if(m_f_ssl) { m_client = static_cast<WiFiClient*>(&clientsecure); if(m_f_ssl && port == 80) port = 443;} |
821 | | - else { m_client = static_cast<WiFiClient*>(&client); } |
| 820 | + if(m_f_ssl) { m_client = static_cast<NetworkClientSecure*>(&clientsecure); if(m_f_ssl && port == 80) port = 443;} |
| 821 | + else { m_client = static_cast<NetworkClient*>(&client); } |
822 | 822 | if(f_equal) AUDIO_INFO("The host has disconnected, reconnecting"); |
823 | 823 |
|
824 | 824 | if(!m_client->connect(hwoe.get(), port)) { |
@@ -909,8 +909,8 @@ bool Audio::httpRange(uint32_t seek, uint32_t length){ |
909 | 909 | rqh.append("User-Agent: VLC/3.0.21 LibVLC/3.0.21 AppleWebKit/537.36 (KHTML, like Gecko)\r\n\r\n"); |
910 | 910 |
|
911 | 911 | if(m_client->connected()) {m_client->stop();} |
912 | | - if(m_f_ssl) { m_client = static_cast<WiFiClient*>(&clientsecure); if(m_f_ssl && port == 80) port = 443;} |
913 | | - else { m_client = static_cast<WiFiClient*>(&client); } |
| 912 | + if(m_f_ssl) { m_client = static_cast<NetworkClientSecure*>(&clientsecure); if(m_f_ssl && port == 80) port = 443;} |
| 913 | + else { m_client = static_cast<NetworkClient*>(&client); } |
914 | 914 |
|
915 | 915 | if(!m_client->connect(hwoe.get(), port)) { |
916 | 916 | AUDIO_LOG_ERROR("connection lost %s", c_host.c_get()); |
@@ -999,7 +999,7 @@ bool Audio::connecttospeech(const char* speech, const char* lang) { |
999 | 999 | req.append("Accept: text/html\r\n"); |
1000 | 1000 | req.append("Connection: close\r\n\r\n"); |
1001 | 1001 |
|
1002 | | - m_client = static_cast<WiFiClient*>(&client); |
| 1002 | + m_client = static_cast<NetworkClient*>(&client); |
1003 | 1003 | AUDIO_INFO("connect to \"%s\"", host); |
1004 | 1004 | if(!m_client->connect(host, 80)) { |
1005 | 1005 | AUDIO_LOG_ERROR("Connection failed"); |
|
0 commit comments