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
a42002e4
Unverified
Commit
a42002e4
authored
Jan 02, 2024
by
Wolle
Committed by
GitHub
Jan 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Music files stop before actual end #570
parent
1acd2c1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/Audio.cpp
src/Audio.cpp
+5
-4
src/Audio.h
src/Audio.h
+2
-2
No files found.
src/Audio.cpp
View file @
a42002e4
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
*
*
* Created on: Oct 26.2018
* Created on: Oct 26.2018
*
*
* Version 3.0.8
a
* Version 3.0.8
b
* Updated on:
Dec 29.2023
* Updated on:
Jan 02.2024
* Author: Wolle (schreibfaul1)
* Author: Wolle (schreibfaul1)
*
*
*/
*/
...
@@ -2909,10 +2909,11 @@ void Audio::processLocalFile() {
...
@@ -2909,10 +2909,11 @@ void Audio::processLocalFile() {
FLACDecoderReset
();
FLACDecoderReset
();
}
}
if
(
m_codec
==
CODEC_MP3
)
{
m_resumeFilePos
=
mp3_correctResumeFilePos
(
m_resumeFilePos
);
}
if
(
m_codec
==
CODEC_MP3
)
{
m_resumeFilePos
=
mp3_correctResumeFilePos
(
m_resumeFilePos
);
}
if
(
m_avr_bitrate
)
m_audioCurrentTime
=
((
m_resumeFilePos
-
m_audioDataStart
)
/
m_avr_bitrate
)
*
8
;
if
(
m_avr_bitrate
)
m_audioCurrentTime
=
((
double
)(
m_resumeFilePos
-
m_audioDataStart
)
/
m_avr_bitrate
)
*
8
;
audiofile
.
seek
(
m_resumeFilePos
);
audiofile
.
seek
(
m_resumeFilePos
);
InBuff
.
resetBuffer
();
InBuff
.
resetBuffer
();
byteCounter
=
m_resumeFilePos
;
byteCounter
=
m_resumeFilePos
;
f_fileDataComplete
=
false
;
// #570
if
(
m_f_Log
)
{
if
(
m_f_Log
)
{
log_i
(
"m_resumeFilePos %i"
,
m_resumeFilePos
);
log_i
(
"m_resumeFilePos %i"
,
m_resumeFilePos
);
...
@@ -4810,7 +4811,7 @@ bool Audio::playSample(int16_t sample[2]) {
...
@@ -4810,7 +4811,7 @@ bool Audio::playSample(int16_t sample[2]) {
esp_err_t
err
=
i2s_write
((
i2s_port_t
)
m_i2s_num
,
(
const
char
*
)
&
s32
,
sizeof
(
uint32_t
),
&
m_i2s_bytesWritten
,
0
);
// no wait
esp_err_t
err
=
i2s_write
((
i2s_port_t
)
m_i2s_num
,
(
const
char
*
)
&
s32
,
sizeof
(
uint32_t
),
&
m_i2s_bytesWritten
,
0
);
// no wait
#endif
#endif
if
(
err
!=
ESP_OK
)
{
if
(
err
!=
ESP_OK
)
{
log_e
(
"ESP32 Errorcode %i"
,
err
);
if
(
err
/
home
/
wolle
/
Arduino
/
AudioI2S
/
src
/
Audio
.
h
!=
263
)
{
log_e
(
"ESP32 Errorcode: %i"
,
err
);}
return
false
;
return
false
;
}
}
if
(
m_i2s_bytesWritten
<
4
)
{
// no more space in dma buffer --> break and try it later
if
(
m_i2s_bytesWritten
<
4
)
{
// no more space in dma buffer --> break and try it later
...
...
src/Audio.h
View file @
a42002e4
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
*
*
* Created on: Oct 28,2018
* Created on: Oct 28,2018
*
*
* Version 3.0.8
a
* Version 3.0.8
b
* Updated on:
Dec 25.2023
* Updated on:
Jan 02.2024
* Author: Wolle (schreibfaul1)
* 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