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
985fa6e9
Commit
985fa6e9
authored
Apr 07, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better computeAudioTime() for WAV and FLAC
parent
2b54e39a
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
54 deletions
+89
-54
src/Audio.cpp
src/Audio.cpp
+81
-48
src/Audio.h
src/Audio.h
+8
-6
No files found.
src/Audio.cpp
View file @
985fa6e9
This diff is collapsed.
Click to expand it.
src/Audio.h
View file @
985fa6e9
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
*
*
* Created on: Oct 28,2018
* Created on: Oct 28,2018
*
*
* Version 3.0.9
a
* Version 3.0.9
b
* Updated on: Apr 0
4
.2024
* Updated on: Apr 0
7
.2024
* Author: Wolle (schreibfaul1)
* Author: Wolle (schreibfaul1)
*/
*/
...
@@ -136,7 +136,7 @@ public:
...
@@ -136,7 +136,7 @@ public:
bool
openai_speech
(
const
String
&
api_key
,
const
String
&
model
,
const
String
&
input
,
const
String
&
voice
,
const
String
&
response_format
,
const
String
&
speed
);
bool
openai_speech
(
const
String
&
api_key
,
const
String
&
model
,
const
String
&
input
,
const
String
&
voice
,
const
String
&
response_format
,
const
String
&
speed
);
bool
connecttohost
(
const
char
*
host
,
const
char
*
user
=
""
,
const
char
*
pwd
=
""
);
bool
connecttohost
(
const
char
*
host
,
const
char
*
user
=
""
,
const
char
*
pwd
=
""
);
bool
connecttospeech
(
const
char
*
speech
,
const
char
*
lang
);
bool
connecttospeech
(
const
char
*
speech
,
const
char
*
lang
);
bool
connecttoFS
(
fs
::
FS
&
fs
,
const
char
*
path
,
int32_t
resumeFile
Pos
=
-
1
);
bool
connecttoFS
(
fs
::
FS
&
fs
,
const
char
*
path
,
int32_t
m_fileStart
Pos
=
-
1
);
bool
setFileLoop
(
bool
input
);
//TEST loop
bool
setFileLoop
(
bool
input
);
//TEST loop
void
setConnectionTimeout
(
uint16_t
timeout_ms
,
uint16_t
timeout_ms_ssl
);
void
setConnectionTimeout
(
uint16_t
timeout_ms
,
uint16_t
timeout_ms_ssl
);
bool
setAudioPlayPosition
(
uint16_t
sec
);
bool
setAudioPlayPosition
(
uint16_t
sec
);
...
@@ -210,7 +210,7 @@ private:
...
@@ -210,7 +210,7 @@ private:
int
findNextSync
(
uint8_t
*
data
,
size_t
len
);
int
findNextSync
(
uint8_t
*
data
,
size_t
len
);
int
sendBytes
(
uint8_t
*
data
,
size_t
len
);
int
sendBytes
(
uint8_t
*
data
,
size_t
len
);
void
setDecoderItems
();
void
setDecoderItems
();
void
compute
_audioCurrent
Time
(
uint16_t
bytesDecoderIn
,
uint16_t
bytesDecoderOut
);
void
compute
Audio
Time
(
uint16_t
bytesDecoderIn
,
uint16_t
bytesDecoderOut
);
void
printProcessLog
(
int
r
,
const
char
*
s
=
""
);
void
printProcessLog
(
int
r
,
const
char
*
s
=
""
);
void
printDecodeError
(
int
r
);
void
printDecodeError
(
int
r
);
void
showID3Tag
(
const
char
*
tag
,
const
char
*
val
);
void
showID3Tag
(
const
char
*
tag
,
const
char
*
val
);
...
@@ -543,17 +543,19 @@ private:
...
@@ -543,17 +543,19 @@ private:
uint32_t
m_contentlength
=
0
;
// Stores the length if the stream comes from fileserver
uint32_t
m_contentlength
=
0
;
// Stores the length if the stream comes from fileserver
uint32_t
m_bytesNotDecoded
=
0
;
// pictures or something else that comes with the stream
uint32_t
m_bytesNotDecoded
=
0
;
// pictures or something else that comes with the stream
uint32_t
m_PlayingStartTime
=
0
;
// Stores the milliseconds after the start of the audio
uint32_t
m_PlayingStartTime
=
0
;
// Stores the milliseconds after the start of the audio
int32_t
m_resumeFilePos
=
-
1
;
// the return value from stopSong() can be entered here, (-1) is idle
int32_t
m_resumeFilePos
=
-
1
;
// the return value from stopSong(), (-1) is idle
int32_t
m_fileStartPos
=
-
1
;
// may be set in connecttoFS()
uint16_t
m_m3u8_targetDuration
=
10
;
//
uint16_t
m_m3u8_targetDuration
=
10
;
//
uint32_t
m_stsz_numEntries
=
0
;
// num of entries inside stsz atom (uint32_t)
uint32_t
m_stsz_numEntries
=
0
;
// num of entries inside stsz atom (uint32_t)
uint32_t
m_stsz_position
=
0
;
// pos of stsz atom within file
uint32_t
m_stsz_position
=
0
;
// pos of stsz atom within file
uint32_t
m_haveNewFilePos
=
0
;
// user changed the file position
bool
m_f_metadata
=
false
;
// assume stream without metadata
bool
m_f_metadata
=
false
;
// assume stream without metadata
bool
m_f_unsync
=
false
;
// set within ID3 tag but not used
bool
m_f_unsync
=
false
;
// set within ID3 tag but not used
bool
m_f_exthdr
=
false
;
// ID3 extended header
bool
m_f_exthdr
=
false
;
// ID3 extended header
bool
m_f_ssl
=
false
;
bool
m_f_ssl
=
false
;
bool
m_f_running
=
false
;
bool
m_f_running
=
false
;
bool
m_f_firstCall
=
false
;
// InitSequence for processWebstream and processLokalFile
bool
m_f_firstCall
=
false
;
// InitSequence for processWebstream and processLokalFile
bool
m_f_firstCurTimeCall
=
false
;
// InitSequence for compute
_audioCurrent
Time
bool
m_f_firstCurTimeCall
=
false
;
// InitSequence for compute
Audio
Time
bool
m_f_firstM3U8call
=
false
;
// InitSequence for m3u8 parsing
bool
m_f_firstM3U8call
=
false
;
// InitSequence for m3u8 parsing
bool
m_f_chunked
=
false
;
// Station provides chunked transfer
bool
m_f_chunked
=
false
;
// Station provides chunked transfer
bool
m_f_firstmetabyte
=
false
;
// True if first metabyte (counter)
bool
m_f_firstmetabyte
=
false
;
// True if first metabyte (counter)
...
...
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