用于 Go 的 ID3 解码和编码库
Implementation of ID3 v2.3 and v2.4 in native Go.
go get -u github.com/bogem/id3v2/v2https://pkg.go.dev/github.com/bogem/id3v2/v2
…pictures := tag.GetFrames(tag.CommonID("Attached picture"))
for _, f := range pictures {
pic, ok := f.(id3v2.PictureFrame)
if !ok {
log.Fatal("Couldn't assert picture frame")
}
// Do something with picture frame
fmt.Println(pic.Description)
}For example, if you want to set comment frame with custom encoding, you may do the following:
comment := id3v2.CommentFrame{
Encoding: id3v2.EncodingUTF16,
Language: "ger",
Description: "Tier",
Text: "Der Löwe",
}
tag.AddCommentFrame(comment)Text field will be automatically encoded with UTF-16BE with BOM and written to w.
UTF-8 is default for v2.4, ISO-8859-1 - for v2.3.
暂无开放 Issues,或尚未同步最近议题。