Add Decoder Registry

Add Raw Decoder
This commit is contained in:
Emmm Monster committed 2020-12-26 15:47:10 +08:00
1 parent 1aa5731225
commit d5031e1935
8 files changed
+123 -11

No files matched your search

+11 -1
View File
@@ -45,7 +45,7 @@ func (d *Decoder) GetMeta() common.Meta {
return nil
}
func NewDecoder(data []byte) *Decoder {
func NewDecoder(data []byte) common.Decoder {
return &Decoder{file: data}
}
@@ -84,3 +84,13 @@ func (d *Decoder) Decode() error {
}
return nil
}
func init() {
// Xiami Wav/M4a/Mp3/Flac
common.RegisterDecoder("xm", NewDecoder)
// Xiami Typed Format
// todo: Init With Type
common.RegisterDecoder("wav", NewDecoder)
common.RegisterDecoder("mp3", NewDecoder)
common.RegisterDecoder("flac", NewDecoder)
common.RegisterDecoder("m4a", NewDecoder)
}