I have an mp3 file and, when I load it in a media player, the media player displays the cover of the album. I presume the cover is in the file's metadata, so I'm wondering if there's a way to get to that cover in golang.
How do I set cover for mp3 file?
The name of this property is ID3.
You can use Library dhowden/tag to do this.
m, err := tag.ReadFrom(f)
if err != nil {
log.Fatal(err)
}
log.Print(m.Format()) // The detected format.
log.Print(m.Title()) // The title of the track (see Metadata interface for more details).
type of m.Picture()
is Picture...
enjoy it!
another lib : - https://github.com/mikkyang/id3-go