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 33namespace audio_tools {
44
55/* *
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.
810 * @ingroup codecs
911 * @ingroup decoder
1012 * @author Phil Schatzmann
@@ -64,12 +66,12 @@ class MimeDetector {
6466 const uint8_t * start = (const uint8_t *)data;
6567 if (start[0 ] == 0xFF && start[1 ] == 0xF1 ) {
6668 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 ) {
6971 mime = " audio/mpeg" ;
70- } else if (memcmp (start, " RIFF" , 4 )== 0 ) {
72+ } else if (memcmp (start, " RIFF" , 4 ) == 0 ) {
7173 mime = " audio/vnd.wave" ;
72- } else if (memcmp (start, " OggS" , 4 )== 0 ) {
74+ } else if (memcmp (start, " OggS" , 4 ) == 0 ) {
7375 mime = " audio/ogg" ;
7476 }
7577 }
You can’t perform that action at this time.
0 commit comments