Add Decoder Registry

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

View File

@ -26,7 +26,7 @@ var (
0x5C, 0x5D, 0x26, 0x30, 0x55, 0x3C, 0x27, 0x28}
)
func NewDecoder(data []byte) *Decoder {
func NewDecoder(data []byte) common.Decoder {
return &Decoder{
file: data,
fileLen: uint32(len(data)),
@ -255,3 +255,8 @@ func (d Decoder) GetCoverImage() []byte {
func (d Decoder) GetMeta() common.Meta {
return d.meta
}
func init() {
// Netease Mp3/Flac
common.RegisterDecoder("ncm", NewDecoder)
}