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
1d1c153d
Commit
1d1c153d
authored
May 20, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
celt switch mono -> stereo
mono stations are working now
https://icecast.walmradio.com:8443/otr_opus
parent
cbc9e1b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+7
-7
No files found.
src/opus_decoder/opus_decoder.cpp
View file @
1d1c153d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* based on Xiph.Org Foundation celt decoder
* based on Xiph.Org Foundation celt decoder
*
*
* Created on: 26.01.2023
* Created on: 26.01.2023
* Updated on:
03.04
.2024
* Updated on:
20.05
.2024
*/
*/
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// O G G / O P U S I M P L.
// O G G / O P U S I M P L.
...
@@ -61,17 +61,12 @@ float s_opusCompressionRatio = 0;
...
@@ -61,17 +61,12 @@ float s_opusCompressionRatio = 0;
std
::
vector
<
uint32_t
>
s_opusBlockPicItem
;
std
::
vector
<
uint32_t
>
s_opusBlockPicItem
;
bool
OPUSDecoder_AllocateBuffers
(){
bool
OPUSDecoder_AllocateBuffers
(){
const
uint32_t
CELT_SET_END_BAND_REQUEST
=
10012
;
const
uint32_t
CELT_SET_SIGNALLING_REQUEST
=
10016
;
s_opusChbuf
=
(
char
*
)
malloc
(
512
);
s_opusChbuf
=
(
char
*
)
malloc
(
512
);
if
(
!
CELTDecoder_AllocateBuffers
())
{
log_e
(
"CELT not init"
);
return
false
;}
if
(
!
CELTDecoder_AllocateBuffers
())
{
log_e
(
"CELT not init"
);
return
false
;}
s_opusSegmentTable
=
(
uint16_t
*
)
malloc
(
256
*
sizeof
(
uint16_t
));
s_opusSegmentTable
=
(
uint16_t
*
)
malloc
(
256
*
sizeof
(
uint16_t
));
if
(
!
s_opusSegmentTable
)
{
log_e
(
"CELT not init"
);
return
false
;}
if
(
!
s_opusSegmentTable
)
{
log_e
(
"CELT not init"
);
return
false
;}
CELTDecoder_ClearBuffer
();
OPUSDecoder_ClearBuffers
();
OPUSDecoder_ClearBuffers
();
s_opusError
=
celt_decoder_init
(
2
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
// allocate CELT buffers after OPUS head (nr of channels is needed)
s_opusError
=
celt_decoder_ctl
(
CELT_SET_SIGNALLING_REQUEST
,
0
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
s_opusError
=
celt_decoder_ctl
(
CELT_SET_END_BAND_REQUEST
,
21
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
OPUSsetDefaults
();
OPUSsetDefaults
();
int32_t
ret
=
0
,
silkDecSizeBytes
=
0
;
int32_t
ret
=
0
,
silkDecSizeBytes
=
0
;
...
@@ -805,6 +800,11 @@ int parseOpusHead(uint8_t *inbuf, int nBytes){ // reference https://wiki.xiph.o
...
@@ -805,6 +800,11 @@ int parseOpusHead(uint8_t *inbuf, int nBytes){ // reference https://wiki.xiph.o
(
void
)
outputGain
;
(
void
)
outputGain
;
CELTDecoder_ClearBuffer
();
s_opusError
=
celt_decoder_init
(
s_opusChannels
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
s_opusError
=
celt_decoder_ctl
(
CELT_SET_SIGNALLING_REQUEST
,
0
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
s_opusError
=
celt_decoder_ctl
(
CELT_SET_END_BAND_REQUEST
,
21
);
if
(
s_opusError
<
0
)
{
log_e
(
"CELT not init"
);
return
false
;}
return
1
;
return
1
;
}
}
...
...
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