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
cc1a493e
Unverified
Commit
cc1a493e
authored
Apr 03, 2019
by
Wolle
Committed by
GitHub
Apr 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
works now with podcasts
parent
ab189c20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
src/Audio.cpp
src/Audio.cpp
+36
-2
src/Audio.h
src/Audio.h
+1
-1
No files found.
src/Audio.cpp
View file @
cc1a493e
...
...
@@ -2,7 +2,7 @@
* Audio.cpp
*
* Created on: Oct 26,2018
* Updated on:
Jan 15
,2019
* Updated on:
Apr 03
,2019
* Author: Wolle
*
* This library plays mp3 files from SD card or icy-webstream via I2S
...
...
@@ -1287,8 +1287,42 @@ int Audio::sendBytes(uint8_t *data, size_t len) {
static
int
lastret
=
0
,
count
=
0
;
if
(
!
m_f_playing
){
if
((
data
[
0
]
==
'I'
)
&&
(
data
[
1
]
==
'D'
)
&&
(
data
[
2
]
==
'3'
)){
// it is not a usual radio stream, it is a podcast
log_i
(
"Podcast found!"
);
m_id3Size
=
data
[
6
];
m_id3Size
=
m_id3Size
<<
7
;
m_id3Size
|=
data
[
7
];
m_id3Size
=
m_id3Size
<<
7
;
m_id3Size
|=
data
[
8
];
m_id3Size
=
m_id3Size
<<
7
;
m_id3Size
|=
data
[
9
];
m_rev
=
data
[
3
];
switch
(
m_rev
)
{
case
2
:
m_f_unsync
=
(
data
[
5
]
&
0x80
);
m_f_exthdr
=
false
;
break
;
case
3
:
case
4
:
m_f_unsync
=
(
data
[
5
]
&
0x80
);
// bit7
m_f_exthdr
=
(
data
[
5
]
&
0x40
);
// bit6 extended header
break
;
};
sprintf
(
chbuf
,
"ID3 version=%i"
,
m_rev
);
if
(
audio_info
)
audio_info
(
chbuf
);
sprintf
(
chbuf
,
"ID3 framesSize=%i"
,
m_id3Size
);
if
(
audio_info
)
audio_info
(
chbuf
);
}
// skip ID3
if
(
m_id3Size
>
1000
){
m_id3Size
-=
1000
;
return
1000
;
}
if
(
m_id3Size
>
0
){
int
tmp
=
m_id3Size
;
m_id3Size
=
0
;
return
tmp
;
}
// mad_stream_buffer(stream, data, len);
if
(
m_f_mp3
)
m_nextSync
=
mp3decoder
.
MP3FindSyncWord
(
data
,
len
);
if
(
m_nextSync
==-
1
)
{
if
(
audio_info
)
audio_info
(
"syncword not found"
);
...
...
src/Audio.h
View file @
cc1a493e
...
...
@@ -2,7 +2,7 @@
* Audio.h
*
* Created on: Oct 26,2018
* Updated on:
Jan 15
,2019
* Updated on:
Apr 03
,2019
* Author: Wolle (schreibfaul1)
*/
...
...
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