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
6bedb144
Commit
6bedb144
authored
Feb 05, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opus detect metadata blockpicture correct
parent
cf88468f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
239 additions
and
122 deletions
+239
-122
src/Audio.cpp
src/Audio.cpp
+3
-3
src/Audio.h
src/Audio.h
+2
-2
src/opus_decoder/celt.cpp
src/opus_decoder/celt.cpp
+44
-45
src/opus_decoder/celt.h
src/opus_decoder/celt.h
+15
-11
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+171
-60
src/opus_decoder/opus_decoder.h
src/opus_decoder/opus_decoder.h
+4
-1
No files found.
src/Audio.cpp
View file @
6bedb144
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.8
j
* Updated on: Feb 0
2
.2024
* Version 3.0.8
k
* Updated on: Feb 0
5
.2024
* Author: Wolle (schreibfaul1)
*
*/
...
...
@@ -2960,7 +2960,7 @@ void Audio::processLocalFile() {
}
}
}
AUDIO_INFO
(
"audio file is corrupt --> send EOF"
);
// no return, fall through
if
(
m_codec
==
CODEC_MP3
)
AUDIO_INFO
(
"audio file is corrupt --> send EOF"
);
// no return, fall through
}
}
...
...
src/Audio.h
View file @
6bedb144
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 28,2018
*
* Version 3.0.8
j
* Updated on: Feb 0
2
.2024
* Version 3.0.8
k
* Updated on: Feb 0
5
.2024
* Author: Wolle (schreibfaul1)
*/
...
...
src/opus_decoder/celt.cpp
View file @
6bedb144
This diff is collapsed.
Click to expand it.
src/opus_decoder/celt.h
View file @
6bedb144
...
...
@@ -36,6 +36,9 @@
#pragma GCC optimize ("Os")
#include "Arduino.h"
#include <stdint.h>
#include <cstddef>
#include <assert.h>
#define OPUS_RESET_STATE 4028
#define OPUS_GET_SAMPLE_RATE_REQUEST 4029
...
...
@@ -183,8 +186,8 @@ struct CELTMode {
extern
const
CELTMode
m_CELTMode
;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define
_
min(a,b) ((a)<(b)?(a):(b))
#define
_
max(a,b) ((a)>(b)?(a):(b))
inline
int32_t
S_MUL
(
int32_t
a
,
int16_t
b
){
return
(
int64_t
)
b
*
a
>>
15
;}
#define C_MUL(m,a,b) do{ (m).r = SUB32_ovflw(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \
...
...
@@ -206,7 +209,8 @@ inline int32_t S_MUL(int32_t a, int16_t b){return (int64_t)b * a >> 15;}
#define EC_MINI(_a,_b) ((_a)+(((_b)-(_a))&-((_b)<(_a))))
#define EC_CLZ0 ((int32_t)sizeof(uint32_t)*CHAR_BIT)
#define _CHAR_BIT 8
#define EC_CLZ0 ((int32_t)sizeof(uint32_t)*_CHAR_BIT)
#define EC_CLZ(_x) (__builtin_clz(_x))
#define EC_ILOG(_x) (EC_CLZ0-EC_CLZ(_x))
...
...
@@ -342,8 +346,8 @@ inline int32_t celt_sudiv(int32_t n, int32_t d) {
inline
int16_t
sig2word16
(
int32_t
x
){
x
=
PSHR
(
x
,
12
);
x
=
max
(
x
,
-
32768
);
x
=
min
(
x
,
32767
);
x
=
_
max
(
x
,
-
32768
);
x
=
_
min
(
x
,
32767
);
return
(
int16_t
)(
x
);
}
...
...
@@ -378,10 +382,10 @@ inline int32_t celt_maxabs16(const int16_t *x, int32_t len) {
int16_t
maxval
=
0
;
int16_t
minval
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
maxval
=
max
(
maxval
,
x
[
i
]);
minval
=
min
(
minval
,
x
[
i
]);
maxval
=
_
max
(
maxval
,
x
[
i
]);
minval
=
_
min
(
minval
,
x
[
i
]);
}
return
max
(
EXTEND32
(
maxval
),
-
EXTEND32
(
minval
));
return
_
max
(
EXTEND32
(
maxval
),
-
EXTEND32
(
minval
));
}
inline
int32_t
celt_maxabs32
(
const
int32_t
*
x
,
int32_t
len
)
{
...
...
@@ -389,10 +393,10 @@ inline int32_t celt_maxabs32(const int32_t *x, int32_t len) {
int32_t
maxval
=
0
;
int32_t
minval
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
maxval
=
max
(
maxval
,
x
[
i
]);
minval
=
min
(
minval
,
x
[
i
]);
maxval
=
_
max
(
maxval
,
x
[
i
]);
minval
=
_
min
(
minval
,
x
[
i
]);
}
return
max
(
maxval
,
-
minval
);
return
_
max
(
maxval
,
-
minval
);
}
/** Integer log in base2. Undefined for zero and negative numbers */
...
...
src/opus_decoder/opus_decoder.cpp
View file @
6bedb144
This diff is collapsed.
Click to expand it.
src/opus_decoder/opus_decoder.h
View file @
6bedb144
...
...
@@ -3,7 +3,10 @@
//#pragma GCC optimize ("O3")
//#pragma GCC diagnostic ignored "-Wnarrowing"
#include "Arduino.h"
#include <stdint.h>
#include <memory.h>
enum
:
int8_t
{
OPUS_PARSE_OGG_DONE
=
100
,
ERR_OPUS_NONE
=
0
,
...
...
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