Fixed #12: Add sniffer for .dff

This commit is contained in:
Emmm Monster 2021-05-25 12:20:04 +08:00
parent 15e340eac4
commit 60c15894c0
No known key found for this signature in database
GPG Key ID: C98279C83FB50DB9

View File

@ -12,6 +12,7 @@ var snifferRegistry = map[string]Sniffer{
".wav": SnifferWAV, ".wav": SnifferWAV,
".wma": SnifferWMA, ".wma": SnifferWMA,
".aac": SnifferAAC, ".aac": SnifferAAC,
".dff": SnifferDFF,
} }
func SniffAll(header []byte) (string, bool) { func SniffAll(header []byte) (string, bool) {
@ -46,3 +47,9 @@ func SnifferWMA(header []byte) bool {
func SnifferAAC(header []byte) bool { func SnifferAAC(header []byte) bool {
return bytes.HasPrefix(header, []byte{0xFF, 0xF1}) return bytes.HasPrefix(header, []byte{0xFF, 0xF1})
} }
// SnifferDFF sniff a DSDIFF format
// reference to: https://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf
func SnifferDFF(header []byte) bool {
return bytes.HasPrefix(header, []byte("FRM8"))
}