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
5ac109cc
Commit
5ac109cc
authored
Feb 02, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add NARROW WIDE and SUPERWIDEBAND
parent
3033dfe1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+19
-1
No files found.
src/opus_decoder/opus_decoder.cpp
View file @
5ac109cc
...
...
@@ -75,10 +75,13 @@ void OPUSsetDefaults(){
int
OPUSDecode
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
short
*
outbuf
){
const
uint32_t
CELT_SET_END_BAND_REQUEST
=
10012
;
static
uint16_t
fs
=
0
;
static
uint8_t
M
=
0
;
static
uint8_t
configNr
=
31
;
// FULLBAND
static
uint16_t
paddingBytes
=
0
;
uint8_t
paddingLength
=
0
;
uint8_t
endband
=
21
;
static
uint16_t
samplesPerFrame
=
0
;
int
ret
=
ERR_OPUS_NONE
;
int
len
=
0
;
...
...
@@ -101,12 +104,27 @@ int OPUSDecode(uint8_t *inbuf, int *bytesLeft, short *outbuf){
s_opusSegmentTableSize
--
;
len
=
s_opusSegmentTable
[
s_opusSegmentTableRdPtr
];
}
parseOpusTOC
(
inbuf
[
0
]);
configNr
=
parseOpusTOC
(
inbuf
[
0
]);
samplesPerFrame
=
opus_packet_get_samples_per_frame
(
inbuf
,
s_opusSamplerate
);
switch
(
configNr
){
case
16
...
19
:
endband
=
13
;
// OPUS_BANDWIDTH_NARROWBAND
break
;
case
20
...
23
:
endband
=
17
;
// OPUS_BANDWIDTH_WIDEBAND
break
;
case
24
...
27
:
endband
=
19
;
// OPUS_BANDWIDTH_SUPERWIDEBAND
break
;
case
28
...
31
:
endband
=
21
;
// OPUS_BANDWIDTH_FULLBAND
break
;
default:
log_e
(
"unknown bandwidth, configNr is: %i"
,
configNr
);
break
;
}
celt_decoder_ctl
(
CELT_SET_END_BAND_REQUEST
,
endband
);
}
FramePacking:
// https://www.tech-invite.com/y65/tinv-ietf-rfc-6716-2.html 3.2. Frame Packing
switch
(
s_opusCountCode
){
case
0
:
// Code 0: One Frame in the Packet
*
bytesLeft
-=
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