Documentation ¶
Overview ¶
Package taglib provides utilities for parsing audio tags in various formats.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnrecognizedFormat = errors.New("taglib: format not recognized")
)
Functions ¶
This section is empty.
Types ¶
type GenericTag ¶
type GenericTag interface { Title() string Artist() string Album() string Comment() string Genre() string Year() time.Time Track() uint32 }
GenericTag is implemented by all the tag types in this project. It gives an incomplete view of the information in each tag type, but is good enough for most purposes.
func Decode ¶
func Decode(r io.ReaderAt, size int64) (GenericTag, error)
Decode reads r and determines which tag format the data is in, if any, and calls the decoding function for that format. size indicates the total number of bytes accessible through r.
Example ¶
f, err := os.Open("testdata/test24.mp3") if err != nil { panic(err) } tag, err := Decode(f) if err != nil { panic(err) } fmt.Println("Title:", tag.Title()) fmt.Println("Artist:", tag.Artist()) fmt.Println("Album:", tag.Album()) fmt.Println("Genre:", tag.Genre()) fmt.Println("Year:", tag.Year()) fmt.Println("Track:", tag.Track())
Output: Title: Test Name Artist: Test Artist Album: Test Album Genre: Classical Year: 2008-01-01 00:00:00 +0000 UTC Track: 7
Click to show internal directories.
Click to hide internal directories.