go-taglib: github.com/wtolson/go-taglib Index | Files

package taglib

import "github.com/wtolson/go-taglib"

Index

Package Files

taglib.go

Variables

var (
    ErrInvalid = errors.New("invalid file")
)

func GetCCharPointer Uses

func GetCCharPointer(s string) *C.char

type File Uses

type File struct {
    // contains filtered or unexported fields
}

func Read Uses

func Read(filename string) (*File, error)

Reads and parses a music file. Returns an error if the provided filename is not a valid file.

func (*File) Album Uses

func (file *File) Album() string

Returns a string with this tag's album name.

func (*File) Artist Uses

func (file *File) Artist() string

Returns a string with this tag's artist.

func (*File) Bitrate Uses

func (file *File) Bitrate() int

Returns the bitrate of the file in kb/s.

func (*File) Channels Uses

func (file *File) Channels() int

Returns the number of channels in the audio stream.

func (*File) Close Uses

func (file *File) Close()

Close and free the file.

func (*File) Comment Uses

func (file *File) Comment() string

Returns a string with this tag's comment.

func (*File) Genre Uses

func (file *File) Genre() string

Returns a string with this tag's genre.

func (*File) Length Uses

func (file *File) Length() time.Duration

Returns the length of the file.

func (*File) Samplerate Uses

func (file *File) Samplerate() int

Returns the sample rate of the file in Hz.

func (*File) Save Uses

func (file *File) Save() error

Saves the \a file to disk.

func (*File) SetAlbum Uses

func (file *File) SetAlbum(s string)

Sets the tag's album.

func (*File) SetArtist Uses

func (file *File) SetArtist(s string)

Sets the tag's artist.

func (*File) SetComment Uses

func (file *File) SetComment(s string)

Sets the tag's comment.

func (*File) SetGenre Uses

func (file *File) SetGenre(s string)

Sets the tag's genre.

func (*File) SetTag Uses

func (file *File) SetTag(tagname TagName, tagvalue string)

Sets the tag.

func (*File) SetTitle Uses

func (file *File) SetTitle(s string)

Sets the tag's title.

func (*File) SetTrack Uses

func (file *File) SetTrack(i int)

Sets the tag's track number. 0 indicates that this field should be cleared.

func (*File) SetYear Uses

func (file *File) SetYear(i int)

Sets the tag's year. 0 indicates that this field should be cleared.

func (*File) Tag Uses

func (file *File) Tag(tagname TagName) (tagvalue string)

Returns a string with this tag's comment.

func (*File) Title Uses

func (file *File) Title() string

Returns a string with this tag's title.

func (*File) Track Uses

func (file *File) Track() int

Returns the tag's track number or 0 if track number is not set.

func (*File) Year Uses

func (file *File) Year() int

Returns the tag's year or 0 if year is not set.

type TagName Uses

type TagName int
const (
    Album TagName = iota
    Artist
    Bitrate
    Channels
    Comments
    Genre
    Length
    Samplerate
    Title
    Track
    Year
)

Tag names

Package taglib imports 6 packages (graph) and is imported by 16 packages. Updated 2018-07-18. Refresh now. Tools for package owners.