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
f790c7ed
Commit
f790c7ed
authored
May 21, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new typing of some variables #751
parent
1d1c153d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
98 deletions
+98
-98
src/Audio.cpp
src/Audio.cpp
+6
-6
src/flac_decoder/flac_decoder.cpp
src/flac_decoder/flac_decoder.cpp
+74
-74
src/flac_decoder/flac_decoder.h
src/flac_decoder/flac_decoder.h
+18
-18
No files found.
src/Audio.cpp
View file @
f790c7ed
...
...
@@ -4426,7 +4426,7 @@ void Audio::setDecoderItems() {
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
int
Audio
::
sendBytes
(
uint8_t
*
data
,
size_t
len
)
{
int
bytesLeft
;
int
32_t
bytesLeft
;
static
bool
f_setDecodeParamsOnce
=
true
;
int
nextSync
=
0
;
if
(
!
m_f_playing
)
{
...
...
@@ -4443,12 +4443,12 @@ int Audio::sendBytes(uint8_t* data, size_t len) {
switch
(
m_codec
)
{
case
CODEC_WAV
:
m_decodeError
=
0
;
bytesLeft
=
0
;
break
;
case
CODEC_MP3
:
m_decodeError
=
MP3Decode
(
data
,
&
bytesLeft
,
m_outBuff
,
0
);
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_MP3
:
m_decodeError
=
MP3Decode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
,
0
);
break
;
case
CODEC_AAC
:
m_decodeError
=
AACDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_M4A
:
m_decodeError
=
AACDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_FLAC
:
m_decodeError
=
FLACDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_OPUS
:
m_decodeError
=
OPUSDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_VORBIS
:
m_decodeError
=
VORBISDecode
(
data
,
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_OPUS
:
m_decodeError
=
OPUSDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
case
CODEC_VORBIS
:
m_decodeError
=
VORBISDecode
(
data
,
(
int
*
)
&
bytesLeft
,
m_outBuff
);
break
;
default:
{
log_e
(
"no valid codec found codec = %d"
,
m_codec
);
stopSong
();
...
...
src/flac_decoder/flac_decoder.cpp
View file @
f790c7ed
This diff is collapsed.
Click to expand it.
src/flac_decoder/flac_decoder.h
View file @
f790c7ed
...
...
@@ -2,7 +2,7 @@
* flac_decoder.h
*
* Created on: Jul 03,2020
* Updated on: May
18
,2024
* Updated on: May
21
,2024
*
* Author: wolle
*
...
...
@@ -146,22 +146,22 @@ typedef struct FLACFrameHeader_t {
}
FLACFrameHeader_t
;
int
FLACFindSyncWord
(
unsigned
char
*
buf
,
in
t
nBytes
);
boolean
FLACFindMagicWord
(
unsigned
char
*
buf
,
int
nBytes
);
int
32_t
FLACFindSyncWord
(
unsigned
char
*
buf
,
int32_
t
nBytes
);
boolean
FLACFindMagicWord
(
unsigned
char
*
buf
,
int
32_t
nBytes
);
char
*
FLACgetStreamTitle
();
int
FLACparseOGG
(
uint8_t
*
inbuf
,
in
t
*
bytesLeft
);
int
32_t
FLACparseOGG
(
uint8_t
*
inbuf
,
int32_
t
*
bytesLeft
);
vector
<
uint32_t
>
FLACgetMetadataBlockPicture
();
int
parseFlacFirstPacket
(
uint8_t
*
inbuf
,
int16_t
nBytes
);
int
parseMetaDataBlockHeader
(
uint8_t
*
inbuf
,
int16_t
nBytes
);
int
32_t
parseFlacFirstPacket
(
uint8_t
*
inbuf
,
int16_t
nBytes
);
int
32_t
parseMetaDataBlockHeader
(
uint8_t
*
inbuf
,
int16_t
nBytes
);
bool
FLACDecoder_AllocateBuffers
(
void
);
void
FLACDecoder_setDefaults
();
void
FLACDecoder_ClearBuffer
();
void
FLACDecoder_FreeBuffers
();
void
FLACSetRawBlockParams
(
uint8_t
Chans
,
uint32_t
SampRate
,
uint8_t
BPS
,
uint32_t
tsis
,
uint32_t
AuDaLength
);
void
FLACDecoderReset
();
int8_t
FLACDecode
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
shor
t
*
outbuf
);
int8_t
FLACDecodeNative
(
uint8_t
*
inbuf
,
int
*
bytesLeft
,
shor
t
*
outbuf
);
int8_t
flacDecodeFrame
(
uint8_t
*
inbuf
,
int
*
bytesLeft
);
int8_t
FLACDecode
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
int16_
t
*
outbuf
);
int8_t
FLACDecodeNative
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
,
int16_
t
*
outbuf
);
int8_t
flacDecodeFrame
(
uint8_t
*
inbuf
,
int
32_t
*
bytesLeft
);
uint16_t
FLACGetOutputSamps
();
uint64_t
FLACGetTotoalSamplesInStream
();
uint8_t
FLACGetBitsPerSample
();
...
...
@@ -170,17 +170,17 @@ uint32_t FLACGetSampRate();
uint32_t
FLACGetBitRate
();
uint32_t
FLACGetAudioDataStart
();
uint32_t
FLACGetAudioFileDuration
();
uint32_t
readUint
(
uint8_t
nBits
,
int
*
bytesLeft
);
int32_t
readSignedInt
(
int
nBits
,
in
t
*
bytesLeft
);
int64_t
readRiceSignedInt
(
uint8_t
param
,
int
*
bytesLeft
);
uint32_t
readUint
(
uint8_t
nBits
,
int
32_t
*
bytesLeft
);
int32_t
readSignedInt
(
int
32_t
nBits
,
int32_
t
*
bytesLeft
);
int64_t
readRiceSignedInt
(
uint8_t
param
,
int
32_t
*
bytesLeft
);
void
alignToByte
();
int8_t
decodeSubframes
(
int
*
bytesLeft
);
int8_t
decodeSubframe
(
uint8_t
sampleDepth
,
uint8_t
ch
,
int
*
bytesLeft
);
int8_t
decodeFixedPredictionSubframe
(
uint8_t
predOrder
,
uint8_t
sampleDepth
,
uint8_t
ch
,
int
*
bytesLeft
);
int8_t
decodeLinearPredictiveCodingSubframe
(
int
lpcOrder
,
int
sampleDepth
,
uint8_t
ch
,
in
t
*
bytesLeft
);
int8_t
decodeResiduals
(
uint8_t
warmup
,
uint8_t
ch
,
int
*
bytesLeft
);
int8_t
decodeSubframes
(
int
32_t
*
bytesLeft
);
int8_t
decodeSubframe
(
uint8_t
sampleDepth
,
uint8_t
ch
,
int
32_t
*
bytesLeft
);
int8_t
decodeFixedPredictionSubframe
(
uint8_t
predOrder
,
uint8_t
sampleDepth
,
uint8_t
ch
,
int
32_t
*
bytesLeft
);
int8_t
decodeLinearPredictiveCodingSubframe
(
int
32_t
lpcOrder
,
int32_t
sampleDepth
,
uint8_t
ch
,
int32_
t
*
bytesLeft
);
int8_t
decodeResiduals
(
uint8_t
warmup
,
uint8_t
ch
,
int
32_t
*
bytesLeft
);
void
restoreLinearPrediction
(
uint8_t
ch
,
uint8_t
shift
);
int
FLAC_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
in
t
baselen
,
bool
exact
=
false
);
int
32_t
FLAC_specialIndexOf
(
uint8_t
*
base
,
const
char
*
str
,
int32_
t
baselen
,
bool
exact
=
false
);
char
*
flac_x_ps_malloc
(
uint16_t
len
);
char
*
flac_x_ps_calloc
(
uint16_t
len
,
uint8_t
size
);
char
*
flac_x_ps_strdup
(
const
char
*
str
);
...
...
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