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
73afabe1
Unverified
Commit
73afabe1
authored
May 05, 2023
by
Wolle
Committed by
GitHub
May 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AudiobufferSize UINT16_MAX
parent
7d23d28b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
src/Audio.cpp
src/Audio.cpp
+14
-9
src/Audio.h
src/Audio.h
+3
-3
No files found.
src/Audio.cpp
View file @
73afabe1
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.
1s
* Updated on: May 0
3
.2023
* Version 3.0.
2
* Updated on: May 0
5
.2023
* Author: Wolle (schreibfaul1)
*
*/
...
...
@@ -1877,18 +1877,21 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) {
static
size_t
retvalue
=
0
;
static
size_t
atomsize
=
0
;
static
size_t
audioDataPos
=
0
;
if
(
m_controlCounter
==
M4A_BEGIN
)
retvalue
=
0
;
if
(
m_controlCounter
==
M4A_BEGIN
)
retvalue
=
0
;
static
size_t
cnt
=
0
;
if
(
retvalue
)
{
if
(
len
>
InBuff
.
getMaxBlockSize
())
len
=
InBuff
.
getMaxBlockSize
();
if
(
retvalue
>
len
)
{
// if returnvalue > bufferfillsize
retvalue
-=
len
;
// and wait for more bufferdata
cnt
+=
len
;
return
len
;
}
else
{
size_t
tmp
=
retvalue
;
retvalue
=
0
;
cnt
+=
tmp
;
cnt
=
0
;
return
tmp
;
}
return
0
;
...
...
@@ -1977,8 +1980,9 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) {
return
0
;
}
if
(
atomsize
>
len
-
10
){
atomsize
-=
(
len
-
10
);
headerSize
+=
(
len
-
10
);
retvalue
=
(
len
-
10
);}
else
{
m_controlCounter
=
M4A_CHK
;
retvalue
=
atomsize
;
headerSize
+=
atomsize
;}
m_controlCounter
=
M4A_CHK
;
headerSize
+=
atomsize
;
retvalue
=
atomsize
;
return
0
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
@@ -3026,7 +3030,7 @@ void Audio::processWebFile() {
int16_t
bytesAddedToBuffer
=
_client
->
read
(
InBuff
.
getWritePtr
(),
availableBytes
);
if
(
bytesAddedToBuffer
>
0
)
{
if
(
bytesAddedToBuffer
>
0
)
{
byteCounter
+=
bytesAddedToBuffer
;
// Pull request #42
if
(
m_f_chunked
)
m_chunkcount
-=
bytesAddedToBuffer
;
if
(
m_controlCounter
==
100
)
audioDataCount
+=
bytesAddedToBuffer
;
...
...
@@ -3052,8 +3056,9 @@ void Audio::processWebFile() {
// we have a webfile, read the file header first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if
(
m_controlCounter
!=
100
){
if
(
InBuff
.
bufferFilled
()
>
maxFrameSize
){
// read the file header first
InBuff
.
bytesWasRead
(
readAudioHeader
(
InBuff
.
bufferFilled
()));
// #480
}
int32_t
bytesRead
=
readAudioHeader
(
maxFrameSize
);
if
(
bytesRead
>
0
)
InBuff
.
bytesWasRead
(
bytesRead
);
}
return
;
}
...
...
src/Audio.h
View file @
73afabe1
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 28,2018
*
* Version 3.0.
1r
* Updated on: May 0
3
,2023
* Version 3.0.
2
* Updated on: May 0
5
,2023
* Author: Wolle (schreibfaul1)
*/
...
...
@@ -139,7 +139,7 @@ public:
bool
havePSRAM
()
{
return
m_f_psram
;
};
protected:
size_t
m_buffSizePSRAM
=
300000
;
// most webstreams limit the advance to 100...300Kbytes
size_t
m_buffSizePSRAM
=
UINT16_MAX
;
// most webstreams limit the advance to 100...300Kbytes
size_t
m_buffSizeRAM
=
1600
*
5
;
size_t
m_buffSize
=
0
;
size_t
m_freeSpace
=
0
;
...
...
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