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
6b25ca00
Commit
6b25ca00
authored
Apr 03, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new fkt. ogg_correctResumeFilePos()
parent
9c2f9866
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
src/Audio.cpp
src/Audio.cpp
+31
-0
src/Audio.h
src/Audio.h
+1
-0
No files found.
src/Audio.cpp
View file @
6b25ca00
...
...
@@ -6030,6 +6030,37 @@ uint32_t Audio::m4a_correctResumeFilePos(uint32_t resumeFilePos) {
return
pos
;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint32_t
Audio
::
ogg_correctResumeFilePos
(
uint32_t
resumeFilePos
)
{
// The starting point is the next OggS magic word
log_w
(
"in_resumeFilePos %i"
,
resumeFilePos
);
uint8_t
p1
,
p2
,
p3
,
p4
;
boolean
found
=
false
;
uint32_t
pos
=
resumeFilePos
;
audiofile
.
seek
(
pos
);
p1
=
audiofile
.
read
();
p2
=
audiofile
.
read
();
p3
=
audiofile
.
read
();
p4
=
audiofile
.
read
();
pos
+=
4
;
while
(
!
found
||
pos
>=
m_file_size
)
{
if
(
p1
==
'O'
&&
p2
==
'g'
&&
p3
==
'g'
&&
p4
==
'S'
)
{
found
=
true
;
break
;
}
p1
=
p2
;
p2
=
p3
;
p3
=
p4
;
p4
=
audiofile
.
read
();
pos
++
;
}
if
(
found
)
{
log_w
(
"out_resumeFilePos %i"
,
pos
-
4
);
return
(
pos
-
4
);}
stopSong
();
return
0
;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint32_t
Audio
::
flac_correctResumeFilePos
(
uint32_t
resumeFilePos
)
{
// The starting point is the next FLAC syncword
uint8_t
p1
,
p2
;
...
...
src/Audio.h
View file @
6b25ca00
...
...
@@ -253,6 +253,7 @@ private:
void
seek_m4a_stsz
();
void
seek_m4a_ilst
();
uint32_t
m4a_correctResumeFilePos
(
uint32_t
resumeFilePos
);
uint32_t
ogg_correctResumeFilePos
(
uint32_t
resumeFilePos
);
uint32_t
flac_correctResumeFilePos
(
uint32_t
resumeFilePos
);
uint32_t
mp3_correctResumeFilePos
(
uint32_t
resumeFilePos
);
uint8_t
determineOggCodec
(
uint8_t
*
data
,
uint16_t
len
);
...
...
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