1
1
#pragma once
2
2
3
- #include " AudioTools/CoreAudio/AudioBasic/StrView.h"
4
3
#include " AudioTools/AudioCodecs/MP3HeaderParser.h"
4
+ #include " AudioTools/CoreAudio/AudioBasic/StrView.h"
5
5
6
6
namespace audio_tools {
7
7
@@ -10,6 +10,9 @@ namespace audio_tools {
10
10
* By default the following mime types are supported (audio/aac, audio/mpeg,
11
11
* audio/vnd.wave, audio/ogg). You can register your own custom detection logic
12
12
* to cover additional file types.
13
+ *
14
+ * Please not that the distinction between mp3 and aac is difficult and might
15
+ * fail is some cases
13
16
* @ingroup codecs
14
17
* @ingroup decoder
15
18
* @author Phil Schatzmann
@@ -67,15 +70,16 @@ class MimeDetector {
67
70
68
71
static bool checkAACExt (uint8_t * start, size_t len) {
69
72
// quick check
70
- if (!(start[0 ] == 0xFF && (start[1 ] == 0xF0 || start[1 ] == 0xF1 || start[1 ] == 0xF9 )))
73
+ if (!(start[0 ] == 0xFF &&
74
+ (start[1 ] == 0xF0 || start[1 ] == 0xF1 || start[1 ] == 0xF9 )))
71
75
return false ;
72
76
MP3HeaderParser mp3;
73
77
// it should start with a synch word
74
- if (mp3.findSyncWord ((const uint8_t *)start, len)!= 0 ) {
78
+ if (mp3.findSyncWord ((const uint8_t *)start, len) != 0 ) {
75
79
return false ;
76
80
}
77
81
// make sure that it is not an mp3
78
- if (mp3.isValid (start, len)){
82
+ if (mp3.isValid (start, len)) {
79
83
return false ;
80
84
}
81
85
return true ;
0 commit comments