Add support for lyrics.

Not supported in id3v1 and id3v22
This commit is contained in:
Xavier Henner
2015-05-18 09:32:54 +02:00
parent 7a80548ea8
commit 7fac753a70
7 changed files with 75 additions and 0 deletions
+9
View File
@@ -37,6 +37,7 @@ var frames = frameNames(map[string][2]string{
"disc": [2]string{"TPA", "TPOS"},
"genre": [2]string{"TCO", "TCON"},
"picture": [2]string{"PIC", "APIC"},
"lyrics": [2]string{"", "USLT"},
})
// metadataID3v2 is the implementation of Metadata used for ID3v2 tags.
@@ -112,6 +113,14 @@ func (m metadataID3v2) Disc() (int, int) {
return parseXofN(m.getString(frames.Name("disc", m.Format())))
}
func (m metadataID3v2) Lyrics() string {
t, ok := m.frames[frames.Name("lyrics", m.Format())]
if !ok {
return "toto"
}
return t.(*Comm).Text
}
func (m metadataID3v2) Picture() *Picture {
v, ok := m.frames[frames.Name("picture", m.Format())]
if !ok {