Documentation ¶
Overview ¶
Package ncm reads ncm file into memory, and cut it into different parts.
Index ¶
- Constants
- Variables
- type Data
- type NcmFile
- func (nf *NcmFile) CheckHeader() error
- func (nf *NcmFile) Close() error
- func (nf *NcmFile) GetCover() (err error)
- func (nf *NcmFile) GetFDStat() (os.FileInfo, error)
- func (nf *NcmFile) GetKey() (err error)
- func (nf *NcmFile) GetMeta() (err error)
- func (nf *NcmFile) GetMusicData() error
- func (nf *NcmFile) Parse() error
- func (nf *NcmFile) Validate() error
Constants ¶
View Source
const ( // MagicHeader1 is used to check whether the file is ncm format file. MagicHeader1 = 0x4e455443 MagicHeader2 = 0x4d414446 )
Variables ¶
View Source
var ErrExtNcm = errors.New("file should have ext .ncm")
ErrExtNcm represents the file has not ext .ncm
View Source
var ErrLength = errors.New("Length of Integer must be 1,2,4 or 8")
View Source
var ErrMagicHeader = errors.New("magic header does not match")
ErrMagicHeader represents the file's header doesn't match required header
View Source
var ErrNcmFormat = errors.New("file is not NCM format")
ErrNcmFormat represents the file is not a ncm file
Functions ¶
This section is empty.
Types ¶
type NcmFile ¶
type NcmFile struct { Path string FileDir string FileName string Ext string Key Data Meta Data Cover Data Music Data // contains filtered or unexported fields }
NcmFile represents a ncm file on the computer
func NewNcmFile ¶
NewNcmFile create a pointer to ncmfile ncmpath point out where the ncm file is.
func (*NcmFile) CheckHeader ¶
CheckHeader check whether file's first 4 bytes equal to MagicHeader1 and the following 4 bytes equal to MagicHeader2.
func (*NcmFile) GetMusicData ¶
GetMusicData gets the decoded music data.
Click to show internal directories.
Click to hide internal directories.