Skip to content

Commit e1b4350

Browse files
committed
MimeDetector comments
1 parent f3dd667 commit e1b4350

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/AudioTools/CoreAudio/MimeDetector.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
namespace 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
}

0 commit comments

Comments
 (0)