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
f68d41e3
Commit
f68d41e3
authored
Apr 03, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset audioCurrentTime and audioFileDuration if song stops
parent
64b48f61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/Audio.cpp
src/Audio.cpp
+8
-6
No files found.
src/Audio.cpp
View file @
f68d41e3
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.8
x
* Updated on: Apr 0
1
.2024
* Version 3.0.8
y
* Updated on: Apr 0
3
.2024
* Author: Wolle (schreibfaul1)
*
*/
...
...
@@ -2243,11 +2243,12 @@ uint32_t Audio::stopSong() {
// added this before putting 'm_f_localfile = false' in stopSong(); shoulf never occur....
audiofile
.
close
();
AUDIO_INFO
(
"Closing audio file"
);
log_w
(
"Closing audio file"
);
// for debug
}
memset
(
m_outBuff
,
0
,
m_outbuffSize
);
// Clear OutputBuffer
memset
(
m_filterBuff
,
0
,
sizeof
(
m_filterBuff
));
// Clear FilterBuffer
m_validSamples
=
0
;
m_audioCurrentTime
=
0
;
m_audioFileDuration
=
0
;
return
pos
;
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
...
@@ -4790,7 +4791,7 @@ bool Audio::setFilePos(uint32_t pos) {
if
(
m_codec
==
CODEC_VORBIS
)
return
false
;
// not impl. yet
if
(
!
audiofile
)
return
false
;
if
(
pos
<
m_audioDataStart
)
pos
=
m_audioDataStart
;
// issue #96
if
(
pos
>
m_file_size
)
pos
=
m_file_size
;
if
(
pos
>
m_file_size
)
{
pos
=
m_file_size
;
stopSong
();
return
false
;}
m_resumeFilePos
=
pos
;
memset
(
m_outBuff
,
0
,
m_outbuffSize
);
m_validSamples
=
0
;
...
...
@@ -6030,7 +6031,7 @@ uint32_t Audio::flac_correctResumeFilePos(uint32_t resumeFilePos) {
p1
=
audiofile
.
read
();
p2
=
audiofile
.
read
();
pos
+=
2
;
while
(
!
found
||
pos
=
=
m_file_size
)
{
while
(
!
found
||
pos
>
=
m_file_size
)
{
if
(
p1
==
0xFF
&&
p2
==
0xF8
)
{
found
=
true
;
break
;
...
...
@@ -6041,7 +6042,8 @@ uint32_t Audio::flac_correctResumeFilePos(uint32_t resumeFilePos) {
}
if
(
found
)
return
(
pos
-
2
);
return
m_audioDataStart
;
stopSong
();
return
0
;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint32_t
Audio
::
mp3_correctResumeFilePos
(
uint32_t
resumeFilePos
)
{
...
...
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