refactor: move audio sniffer to internal package

This commit is contained in:
Unlock Music Dev
2022-11-22 06:16:40 +08:00
parent 62a38d5ab4
commit 6c168ee536
8 changed files with 86 additions and 72 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"unlock-music.dev/cli/algo/common"
"unlock-music.dev/cli/internal/sniff"
)
type Decoder struct {
@@ -89,7 +90,7 @@ func (d *Decoder) validateDecode() error {
}
d.cipher.Decrypt(buf, 0)
_, ok := common.SniffAll(buf)
_, ok := sniff.AudioExtension(buf)
if !ok {
return errors.New("qmc: detect file type failed")
}