Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ESP32-audioI2S
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ESP32-audioI2S
Commits
71b75236
Unverified
Commit
71b75236
authored
Dec 07, 2023
by
Wolle
Committed by
GitHub
Dec 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icy v2 enabled
parent
2a0ab81b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
src/Audio.cpp
src/Audio.cpp
+15
-6
src/Audio.h
src/Audio.h
+3
-4
No files found.
src/Audio.cpp
View file @
71b75236
...
...
@@ -5,8 +5,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.7
v
* Updated on: Dec 0
4
.2023
* Version 3.0.7
w
* Updated on: Dec 0
7
.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
}
}
...
...
src/Audio.h
View file @
71b75236
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 28,2018
*
* Version 3.0.7
v
* Updated on: Dec 0
4
.2023
* Version 3.0.7
w
* Updated on: Dec 0
7
.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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment