arduino-audio-tools
Toggle main menu visibility
Main Page
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
f
g
i
m
p
r
s
t
u
v
w
Functions
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
i
l
m
n
p
r
s
t
u
v
w
x
y
Enumerations
Related Symbols
Files
File List
File Members
All
Functions
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Friends
Modules
Pages
Loading...
Searching...
No Matches
src
AudioTools
AudioCodecs
HeaderParserAAC.h
1
#pragma once
2
#include "AudioTools/AudioCodecs/CodecADTS.h"
3
#include "AudioTools/CoreAudio/AudioBasic/StrView.h"
4
5
namespace
audio_tools
{
6
16
class
HeaderParserAAC
{
17
public
:
20
bool
isValid
(
const
uint8_t* data,
int
len) {
21
if
(len < 7)
return
false
;
22
parser.begin();
23
// regular validation
24
if
(!parser.parse((uint8_t*)data))
return
false
;
25
// check if we have a valid 2nd frame
26
if
(len >
getFrameLength
()) {
27
int
pos =
findSyncWord
(data, len,
getFrameLength
());
28
if
(pos == -1)
return
false
;
29
}
30
return
true
;
31
}
20
bool
isValid
(
const
uint8_t* data,
int
len) {
…
}
32
33
int
getSampleRate() {
return
parser.getSampleRate(); }
34
35
uint8_t getChannels() {
return
parser.data().channel_cfg; }
36
38
int
getFrameLength
() {
return
parser.getFrameLength(); }
39
41
int
findSyncWord
(
const
uint8_t* buf,
int
nBytes,
int
start = 0) {
42
return
parser.findSyncWord(buf, nBytes, start);
43
}
41
int
findSyncWord
(
const
uint8_t* buf,
int
nBytes,
int
start = 0) {
…
}
44
45
ADTSParser::ADTSHeader
getHeader() {
return
parser.data(); }
46
47
protected
:
48
ADTSParser parser;
49
};
16
class
HeaderParserAAC
{
…
};
50
51
}
// namespace audio_tools
audio_tools::HeaderParserAAC
AAC header parser to check if the data is a valid ADTS aac which can extract some relevant audio info...
Definition
HeaderParserAAC.h:16
audio_tools::HeaderParserAAC::findSyncWord
int findSyncWord(const uint8_t *buf, int nBytes, int start=0)
Finds the mp3/aac sync word.
Definition
HeaderParserAAC.h:41
audio_tools::HeaderParserAAC::getFrameLength
int getFrameLength()
Determines the frame length.
Definition
HeaderParserAAC.h:38
audio_tools::HeaderParserAAC::isValid
bool isValid(const uint8_t *data, int len)
Definition
HeaderParserAAC.h:20
audio_tools
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition
AudioCodecsBase.h:10
audio_tools::ADTSParser::ADTSHeader
Definition
CodecADTS.h:20
Generated by
1.9.8