Fixed #12: Add sniffer for `.dff`

pull/23/head
Emmm Monster 4 years ago
parent 15e340eac4
commit 60c15894c0
No known key found for this signature in database
GPG Key ID: C98279C83FB50DB9

@ -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"))
}

Loading…
Cancel
Save