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
cf88468f
Commit
cf88468f
authored
Feb 03, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little improvements
parent
dd1afff7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/Audio.cpp
src/Audio.cpp
+1
-0
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+2
-2
No files found.
src/Audio.cpp
View file @
cf88468f
...
...
@@ -296,6 +296,7 @@ esp_err_t Audio::I2Sstop(uint8_t i2s_num) {
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void
Audio
::
setDefaults
()
{
stopSong
();
setSampleRate
(
16000
);
// ESP32-S3 -> reduce SR, if 48000Hz a connect to another URL is impossible
initInBuff
();
// initialize InputBuffer if not already done
InBuff
.
resetBuffer
();
MP3Decoder_FreeBuffers
();
...
...
src/opus_decoder/opus_decoder.cpp
View file @
cf88468f
...
...
@@ -19,7 +19,7 @@ bool s_f_opusFramePacket = false;
bool
s_f_opusStereoFlag
=
false
;
uint8_t
s_opusChannels
=
0
;
uint8_t
s_opusCountCode
=
0
;
uint
16
_t
s_opusSamplerate
=
0
;
uint
32
_t
s_opusSamplerate
=
0
;
uint32_t
s_opusSegmentLength
=
0
;
uint32_t
s_opusBlockPicLen
=
0
;
uint32_t
s_opusBlockPicPos
=
0
;
...
...
@@ -365,7 +365,7 @@ int parseOpusHead(uint8_t *inbuf, int nBytes){ // reference https://wiki.xiph.o
outputGain
+=
*
(
inbuf
+
16
);
uint8_t
channelMap
=
*
(
inbuf
+
18
);
if
(
channelCount
==
0
or
channelCount
>
2
)
return
ERR_OPUS_CHANNELS_OUT_OF_RANGE
;
if
(
channelCount
==
0
||
channelCount
>
2
)
return
ERR_OPUS_CHANNELS_OUT_OF_RANGE
;
s_opusChannels
=
channelCount
;
if
(
sampleRate
!=
48000
)
return
ERR_OPUS_INVALID_SAMPLERATE
;
s_opusSamplerate
=
sampleRate
;
...
...
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