From 60c15894c0c0e4ca3fc315753080f85eb52e0b22 Mon Sep 17 00:00:00 2001 From: Emmm Monster <58943012+emmmx@users.noreply.github.com> Date: Tue, 25 May 2021 12:20:04 +0800 Subject: [PATCH] Fixed #12: Add sniffer for `.dff` --- algo/common/sniff.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/algo/common/sniff.go b/algo/common/sniff.go index 899c639..3370305 100644 --- a/algo/common/sniff.go +++ b/algo/common/sniff.go @@ -12,6 +12,7 @@ var snifferRegistry = map[string]Sniffer{ ".wav": SnifferWAV, ".wma": SnifferWMA, ".aac": SnifferAAC, + ".dff": SnifferDFF, } func SniffAll(header []byte) (string, bool) { @@ -46,3 +47,9 @@ func SnifferWMA(header []byte) bool { func SnifferAAC(header []byte) bool { 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")) +}