Unverified Commit 71b75236 authored by Wolle's avatar Wolle Committed by GitHub

icy v2 enabled

parent 2a0ab81b
......@@ -5,8 +5,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.7v
* Updated on: Dec 04.2023
* Version 3.0.7w
* Updated on: Dec 07.2023
* Author: Wolle (schreibfaul1)
*
*/
......@@ -469,7 +469,7 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
strcat(rqh, "Host: ");
strcat(rqh, hostwoext);
strcat(rqh, "\r\n");
strcat(rqh, "Icy-MetaData:1\r\n");
strcat(rqh, "Icy-MetaData:2\r\n");
if(auth > 0) {
strcat(rqh, "Authorization: Basic ");
......@@ -3557,7 +3557,7 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / requ
continue;
}
if(m_f_Log) { log_i("httpResponseHeader: %s", rhl); }
// log_i("httpResponseHeader: %s", rhl);
int16_t posColon = indexOf(rhl, ":", 0); // lowercase all letters up to the colon
if(posColon >= 0) {
......@@ -3650,6 +3650,15 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / requ
; // do nothing Ambient, Rock, etc
}
else if(startsWith(rhl, "icy-logo:")) {
char* c_icylogo = (rhl + 9); // Get logo URL
trim(c_icylogo);
if(strlen(c_icylogo) > 0) {
if(m_f_Log) AUDIO_INFO("icy-logo: %s", c_icylogo);
if(audio_icylogo) audio_icylogo(c_icylogo);
}
}
else if(startsWith(rhl, "icy-br:")) {
const char* c_bitRate = (rhl + 7);
int32_t br = atoi(c_bitRate); // Found bitrate tag, read the bitrate in Kbit
......@@ -3670,7 +3679,7 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / requ
char* c_icyname = (rhl + 9); // Get station name
trim(c_icyname);
if(strlen(c_icyname) > 0) {
if(!m_f_Log) AUDIO_INFO("icy-name: %s", c_icyname);
if(m_f_Log) AUDIO_INFO("icy-name: %s", c_icyname);
if(audio_showstation) audio_showstation(c_icyname);
}
}
......@@ -3697,7 +3706,7 @@ bool Audio::parseHttpResponseHeader() { // this is the response to a GET / requ
else if((startsWith(rhl, "transfer-encoding:"))) {
if(endsWith(rhl, "chunked") || endsWith(rhl, "Chunked")) { // Station provides chunked transfer
m_f_chunked = true;
if(!m_f_Log) AUDIO_INFO("chunked data transfer");
if(m_f_Log) AUDIO_INFO("chunked data transfer");
m_chunkcount = 0; // Expect chunkcount in DATA
}
}
......
......@@ -3,8 +3,8 @@
*
* Created on: Oct 28,2018
*
* Version 3.0.7v
* Updated on: Dec 04.2023
* Version 3.0.7w
* Updated on: Dec 07.2023
* Author: Wolle (schreibfaul1)
*/
......@@ -45,6 +45,7 @@ extern __attribute__((weak)) void audio_showstation(const char*);
extern __attribute__((weak)) void audio_bitrate(const char*);
extern __attribute__((weak)) void audio_commercial(const char*);
extern __attribute__((weak)) void audio_icyurl(const char*);
extern __attribute__((weak)) void audio_icylogo(const char*);
extern __attribute__((weak)) void audio_icydescription(const char*);
extern __attribute__((weak)) void audio_lasthost(const char*);
extern __attribute__((weak)) void audio_eof_speech(const char*);
......@@ -52,8 +53,6 @@ extern __attribute__((weak)) void audio_eof_stream(const char*); // The webstrea
extern __attribute__((weak)) void audio_process_extern(int16_t* buff, uint16_t len, bool *continueI2S); // record audiodata or send via BT
extern __attribute__((weak)) void audio_process_i2s(uint32_t* sample, bool *continueI2S); // record audiodata or send via BT
//----------------------------------------------------------------------------------------------------------------------
class AudioBuffer {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment