File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 3
3
namespace audio_tools {
4
4
5
5
/* *
6
- * @brief Logic to detemine the mime type from the content. You can register
7
- * your own custom detection logic
6
+ * @brief Logic to detemine the mime type from the content.
7
+ * By default the following mime types are supported (audio/aac, audio/mpeg,
8
+ * audio/vnd.wave, audio/ogg). You can register your own custom detection logic
9
+ * to cover additional file types.
8
10
* @ingroup codecs
9
11
* @ingroup decoder
10
12
* @author Phil Schatzmann
@@ -64,12 +66,12 @@ class MimeDetector {
64
66
const uint8_t * start = (const uint8_t *)data;
65
67
if (start[0 ] == 0xFF && start[1 ] == 0xF1 ) {
66
68
mime = " audio/aac" ;
67
- } else if (memcmp (start, " ID3" , 3 )== 0
68
- || start[ 0 ] == 0xFF || start[0 ] == 0xFE ) {
69
+ } else if (memcmp (start, " ID3" , 3 ) == 0 || start[ 0 ] == 0xFF ||
70
+ start[0 ] == 0xFE ) {
69
71
mime = " audio/mpeg" ;
70
- } else if (memcmp (start, " RIFF" , 4 )== 0 ) {
72
+ } else if (memcmp (start, " RIFF" , 4 ) == 0 ) {
71
73
mime = " audio/vnd.wave" ;
72
- } else if (memcmp (start, " OggS" , 4 )== 0 ) {
74
+ } else if (memcmp (start, " OggS" , 4 ) == 0 ) {
73
75
mime = " audio/ogg" ;
74
76
}
75
77
}
You can’t perform that action at this time.
0 commit comments