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
c14b9db9
Commit
c14b9db9
authored
Feb 14, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first changes
parent
f72086a1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
59 deletions
+119
-59
src/Audio.cpp
src/Audio.cpp
+5
-2
src/Audio.h
src/Audio.h
+1
-1
src/flac_decoder/flac_decoder.cpp
src/flac_decoder/flac_decoder.cpp
+110
-54
src/flac_decoder/flac_decoder.h
src/flac_decoder/flac_decoder.h
+1
-0
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+1
-1
src/vorbis_decoder/vorbis_decoder.cpp
src/vorbis_decoder/vorbis_decoder.cpp
+1
-1
No files found.
src/Audio.cpp
View file @
c14b9db9
...
...
@@ -605,7 +605,7 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
m_expectedPlsFmt
=
FORMAT_NONE
;
if
(
res
)
{
log_i
(
"connecttohost(): %s"
,
rqh
);
//
log_i("connecttohost(): %s", rqh);
_client
->
print
(
rqh
);
if
(
endsWith
(
extension
,
".mp3"
))
m_expectedCodec
=
CODEC_MP3
;
if
(
endsWith
(
extension
,
".aac"
))
m_expectedCodec
=
CODEC_AAC
;
...
...
@@ -3033,6 +3033,7 @@ void Audio::processLocalFile() {
stopSong
();
return
;
}
m_controlCounter
=
100
;
if
(
m_controlCounter
!=
100
)
{
if
((
millis
()
-
ctime
)
>
timeout
)
{
log_e
(
"audioHeader reading timeout"
);
...
...
@@ -4261,8 +4262,10 @@ int Audio::findNextSync(uint8_t* data, size_t len) {
nextSync
=
0
;
}
if
(
m_codec
==
CODEC_FLAC
)
{
nextSync
=
OPUSFindSyncWord
(
data
,
len
);
if
(
nextSync
==
-
1
)
return
len
;
// OggS not found, search next block
FLACSetRawBlockParams
(
m_flacNumChannels
,
m_flacSampleRate
,
m_flacBitsPerSample
,
m_flacTotalSamplesInStream
,
m_audioDataSize
);
nextSync
=
FLACFindSyncWord
(
data
,
len
);
//
nextSync = FLACFindSyncWord(data, len);
}
if
(
m_codec
==
CODEC_OPUS
)
{
nextSync
=
OPUSFindSyncWord
(
data
,
len
);
...
...
src/Audio.h
View file @
c14b9db9
...
...
@@ -337,7 +337,7 @@ private:
}
int
specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int
baselen
,
bool
exact
=
false
){
int
result
=
0
;
// seek for str in buffer or in header up to baselen, not nullterninated
int
result
=
-
1
;
// seek for str in buffer or in header up to baselen, not nullterninated
if
(
strlen
(
str
)
>
baselen
)
return
-
1
;
// if exact == true seekstr in buffer must have "\0" at the end
for
(
int
i
=
0
;
i
<
baselen
-
strlen
(
str
);
i
++
){
result
=
i
;
...
...
src/flac_decoder/flac_decoder.cpp
View file @
c14b9db9
This diff is collapsed.
Click to expand it.
src/flac_decoder/flac_decoder.h
View file @
c14b9db9
...
...
@@ -150,6 +150,7 @@ boolean FLACFindMagicWord(unsigned char* buf, int nBytes);
char
*
FLACgetStreamTitle
();
int
FLACparseOGG
(
uint8_t
*
inbuf
,
int
*
bytesLeft
);
bool
FLACDecoder_AllocateBuffers
(
void
);
void
FLACDecoder_setDefaults
();
void
FLACDecoder_ClearBuffer
();
void
FLACDecoder_FreeBuffers
();
void
FLACSetRawBlockParams
(
uint8_t
Chans
,
uint32_t
SampRate
,
uint8_t
BPS
,
uint32_t
tsis
,
uint32_t
AuDaLength
);
...
...
src/opus_decoder/opus_decoder.cpp
View file @
c14b9db9
...
...
@@ -811,7 +811,7 @@ int OPUSFindSyncWord(unsigned char *buf, int nBytes){
}
//----------------------------------------------------------------------------------------------------------------------
int
OPUS_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int
baselen
,
bool
exact
){
int
result
;
// seek for str in buffer or in header up to baselen, not nullterninated
int
result
=
-
1
;
// seek for str in buffer or in header up to baselen, not nullterninated
if
(
strlen
(
str
)
>
baselen
)
return
-
1
;
// if exact == true seekstr in buffer must have "\0" at the end
for
(
int
i
=
0
;
i
<
baselen
-
strlen
(
str
);
i
++
){
result
=
i
;
...
...
src/vorbis_decoder/vorbis_decoder.cpp
View file @
c14b9db9
...
...
@@ -1050,7 +1050,7 @@ _eofout:
//----------------------------------------------------------------------------------------------------------------------
int
VORBIS_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int
baselen
,
bool
exact
){
int
result
=
0
;
// seek for str in buffer or in header up to baselen, not nullterninated
int
result
=
-
1
;
// seek for str in buffer or in header up to baselen, not nullterninated
if
(
strlen
(
str
)
>
baselen
)
return
-
1
;
// if exact == true seekstr in buffer must have "\0" at the end
for
(
int
i
=
0
;
i
<
baselen
-
strlen
(
str
);
i
++
){
result
=
i
;
...
...
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