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
f96506ba
Commit
f96506ba
authored
May 22, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typing short -> int16_t, long int32_t
parent
6c50184e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
49 deletions
+49
-49
src/Audio.cpp
src/Audio.cpp
+2
-2
src/opus_decoder/celt.cpp
src/opus_decoder/celt.cpp
+3
-3
src/opus_decoder/celt.h
src/opus_decoder/celt.h
+1
-1
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+31
-31
src/opus_decoder/opus_decoder.h
src/opus_decoder/opus_decoder.h
+12
-12
No files found.
src/Audio.cpp
View file @
f96506ba
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* Created on: Oct 26.2018
* Created on: Oct 26.2018
*
*
* Version 3.0.9l
* Version 3.0.9l
* Updated on: May
18
.2024
* Updated on: May
22
.2024
* Author: Wolle (schreibfaul1)
* Author: Wolle (schreibfaul1)
*
*
*/
*/
...
@@ -4447,7 +4447,7 @@ int Audio::sendBytes(uint8_t* data, size_t len) {
...
@@ -4447,7 +4447,7 @@ int Audio::sendBytes(uint8_t* data, size_t len) {
case
CODEC_AAC
:
m_decodeError
=
AACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_AAC
:
m_decodeError
=
AACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_M4A
:
m_decodeError
=
AACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_M4A
:
m_decodeError
=
AACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_FLAC
:
m_decodeError
=
FLACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_FLAC
:
m_decodeError
=
FLACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_OPUS
:
m_decodeError
=
OPUSDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_OPUS
:
m_decodeError
=
OPUSDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_VORBIS
:
m_decodeError
=
VORBISDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_VORBIS
:
m_decodeError
=
VORBISDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
default:
{
default:
{
log_e
(
"no valid codec found codec = %d"
,
m_codec
);
log_e
(
"no valid codec found codec = %d"
,
m_codec
);
...
...
src/opus_decoder/celt.cpp
View file @
f96506ba
...
@@ -1979,7 +1979,7 @@ int32_t celt_decoder_init(int32_t channels){
...
@@ -1979,7 +1979,7 @@ int32_t celt_decoder_init(int32_t channels){
return
ERR_OPUS_CELT_ALLOC_FAIL
;
return
ERR_OPUS_CELT_ALLOC_FAIL
;
}
}
int
n
=
celt_decoder_get_size
(
channels
);
int
32_t
n
=
celt_decoder_get_size
(
channels
);
memset
(
s_celtDec
,
0
,
n
*
sizeof
(
char
));
memset
(
s_celtDec
,
0
,
n
*
sizeof
(
char
));
s_celtDec
->
channels
=
channels
;
s_celtDec
->
channels
=
channels
;
...
@@ -2004,7 +2004,7 @@ int32_t celt_decoder_init(int32_t channels){
...
@@ -2004,7 +2004,7 @@ int32_t celt_decoder_init(int32_t channels){
s_celtDec
->
_decode_mem
[
0
]
=
0
;
s_celtDec
->
_decode_mem
[
0
]
=
0
;
s_celtDec
->
end
=
s_celtDec
->
mode
->
effEBands
;
// 21
s_celtDec
->
end
=
s_celtDec
->
mode
->
effEBands
;
// 21
int
ret
=
celt_decoder_ctl
(
OPUS_RESET_STATE
);
int
32_t
ret
=
celt_decoder_ctl
(
OPUS_RESET_STATE
);
if
(
ret
<
0
)
return
ret
;
if
(
ret
<
0
)
return
ret
;
return
ERR_OPUS_NONE
;
return
ERR_OPUS_NONE
;
}
}
...
@@ -2507,7 +2507,7 @@ int32_t celt_decoder_ctl(int32_t request, ...) {
...
@@ -2507,7 +2507,7 @@ int32_t celt_decoder_ctl(int32_t request, ...) {
oldLogE
=
oldBandE
+
2
*
s_celtDec
->
mode
->
nbEBands
;
oldLogE
=
oldBandE
+
2
*
s_celtDec
->
mode
->
nbEBands
;
oldLogE2
=
oldLogE
+
2
*
s_celtDec
->
mode
->
nbEBands
;
oldLogE2
=
oldLogE
+
2
*
s_celtDec
->
mode
->
nbEBands
;
int
n
=
celt_decoder_get_size
(
s_celtDec
->
channels
);
int
32_t
n
=
celt_decoder_get_size
(
s_celtDec
->
channels
);
char
*
dest
=
(
char
*
)
&
s_celtDec
->
rng
;
char
*
dest
=
(
char
*
)
&
s_celtDec
->
rng
;
char
*
offset
=
(
char
*
)
s_celtDec
;
char
*
offset
=
(
char
*
)
s_celtDec
;
memset
(
dest
,
0
,
n
-
(
dest
-
offset
)
*
sizeof
(
s_celtDec
));
memset
(
dest
,
0
,
n
-
(
dest
-
offset
)
*
sizeof
(
s_celtDec
));
...
...
src/opus_decoder/celt.h
View file @
f96506ba
...
@@ -457,7 +457,7 @@ inline void dual_inner_prod(const int16_t *x, const int16_t *y01, const int16_t
...
@@ -457,7 +457,7 @@ inline void dual_inner_prod(const int16_t *x, const int16_t *y01, const int16_t
}
}
inline
uint32_t
celt_inner_prod
(
const
int16_t
*
x
,
const
int16_t
*
y
,
int32_t
N
)
{
inline
uint32_t
celt_inner_prod
(
const
int16_t
*
x
,
const
int16_t
*
y
,
int32_t
N
)
{
int
i
;
int
32_t
i
;
uint32_t
xy
=
0
;
uint32_t
xy
=
0
;
for
(
i
=
0
;
i
<
N
;
i
++
)
xy
=
(
int32_t
)
x
[
i
]
*
(
int32_t
)
y
[
i
]
+
xy
;
for
(
i
=
0
;
i
<
N
;
i
++
)
xy
=
(
int32_t
)
x
[
i
]
*
(
int32_t
)
y
[
i
]
+
xy
;
return
xy
;
return
xy
;
...
...
src/opus_decoder/opus_decoder.cpp
View file @
f96506ba
This diff is collapsed.
Click to expand it.
src/opus_decoder/opus_decoder.h
View file @
f96506ba
...
@@ -36,13 +36,13 @@ bool OPUSDecoder_AllocateBuffers();
...
@@ -36,13 +36,13 @@ bool OPUSDecoder_AllocateBuffers();
void
OPUSDecoder_FreeBuffers
();
void
OPUSDecoder_FreeBuffers
();
void
OPUSDecoder_ClearBuffers
();
void
OPUSDecoder_ClearBuffers
();
void
OPUSsetDefaults
();
void
OPUSsetDefaults
();
int
OPUSDecode
(
uint8_t
*
inbuf
,
in
t
*
bytesLeft
,
short
*
outbuf
);
int
32_t
OPUSDecode
(
uint8_t
*
inbuf
,
int32_
t
*
bytesLeft
,
short
*
outbuf
);
int
opusDecodePage0
(
uint8_t
*
inbuf
,
in
t
*
bytesLeft
,
uint32_t
segmentLength
);
int
32_t
opusDecodePage0
(
uint8_t
*
inbuf
,
int32_
t
*
bytesLeft
,
uint32_t
segmentLength
);
int
opusDecodePage3
(
uint8_t
*
inbuf
,
in
t
*
bytesLeft
,
uint32_t
segmentLength
,
short
*
outbuf
);
int
32_t
opusDecodePage3
(
uint8_t
*
inbuf
,
int32_
t
*
bytesLeft
,
uint32_t
segmentLength
,
short
*
outbuf
);
int8_t
opus_FramePacking_Code0
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
short
*
outbuf
,
in
t
packetLen
,
uint16_t
samplesPerFrame
);
int8_t
opus_FramePacking_Code0
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
short
*
outbuf
,
int32_
t
packetLen
,
uint16_t
samplesPerFrame
);
int8_t
opus_FramePacking_Code1
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
short
*
outbuf
,
in
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
int8_t
opus_FramePacking_Code1
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
short
*
outbuf
,
int32_
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
int8_t
opus_FramePacking_Code2
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
short
*
outbuf
,
in
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
int8_t
opus_FramePacking_Code2
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
short
*
outbuf
,
int32_
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
int8_t
opus_FramePacking_Code3
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
short
*
outbuf
,
in
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
int8_t
opus_FramePacking_Code3
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
short
*
outbuf
,
int32_
t
packetLen
,
uint16_t
samplesPerFrame
,
uint8_t
*
frameCount
);
uint8_t
OPUSGetChannels
();
uint8_t
OPUSGetChannels
();
uint32_t
OPUSGetSampRate
();
uint32_t
OPUSGetSampRate
();
uint8_t
OPUSGetBitsPerSample
();
uint8_t
OPUSGetBitsPerSample
();
...
@@ -51,12 +51,12 @@ uint16_t OPUSGetOutputSamps();
...
@@ -51,12 +51,12 @@ uint16_t OPUSGetOutputSamps();
uint32_t
OPUSGetAudioDataStart
();
uint32_t
OPUSGetAudioDataStart
();
char
*
OPUSgetStreamTitle
();
char
*
OPUSgetStreamTitle
();
vector
<
uint32_t
>
OPUSgetMetadataBlockPicture
();
vector
<
uint32_t
>
OPUSgetMetadataBlockPicture
();
int
OPUSFindSyncWord
(
unsigned
char
*
buf
,
in
t
nBytes
);
int
32_t
OPUSFindSyncWord
(
unsigned
char
*
buf
,
int32_
t
nBytes
);
int
OPUSparseOGG
(
uint8_t
*
inbuf
,
in
t
*
bytesLeft
);
int
32_t
OPUSparseOGG
(
uint8_t
*
inbuf
,
int32_
t
*
bytesLeft
);
int
parseOpusHead
(
uint8_t
*
inbuf
,
in
t
nBytes
);
int
32_t
parseOpusHead
(
uint8_t
*
inbuf
,
int32_
t
nBytes
);
int
parseOpusComment
(
uint8_t
*
inbuf
,
in
t
nBytes
);
int
32_t
parseOpusComment
(
uint8_t
*
inbuf
,
int32_
t
nBytes
);
int8_t
parseOpusTOC
(
uint8_t
TOC_Byte
);
int8_t
parseOpusTOC
(
uint8_t
TOC_Byte
);
int32_t
opus_packet_get_samples_per_frame
(
const
uint8_t
*
data
,
int32_t
Fs
);
int32_t
opus_packet_get_samples_per_frame
(
const
uint8_t
*
data
,
int32_t
Fs
);
// some helper functions
// some helper functions
int
OPUS_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
in
t
baselen
,
bool
exact
=
false
);
int
32_t
OPUS_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int32_
t
baselen
,
bool
exact
=
false
);
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