audio

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unsynchronization = 1 << 7
	ExtendedHeader    = 1 << 6
	Experimental      = 1 << 5
	FooterPresent     = 1 << 4
)

Variables

View Source
var (
	Tracks = &TrackCollection{
		lookup: map[string]*Track{},
	}
)

Functions

func Scan

func Scan(globs ...string) bool

Scan looks for and loads audio tracks. Returns true if any tracks were found and loaded.

Types

type Header struct {
	Tag      string
	Revision int
	Minor    int
	Flags    int
	Size     int
}

func (Header) Flag

func (h Header) Flag(flag int) bool

func (Header) Version

func (h Header) Version() string

type Picture

type Picture struct {
	Mime        string
	Type        string
	Description string
	Data        []byte
}

type Tag

type Tag struct {
	Header  Header
	Title   string
	Artist  string
	Album   string
	Date    string
	Picture *Picture
}

func (*Tag) ParseFrames

func (t *Tag) ParseFrames(r io.Reader) error

func (Tag) String

func (t Tag) String() string

type Track

type Track struct {
	ID   string
	Path string
	Tag  *Tag
}

func (*Track) Artist added in v1.0.5

func (t *Track) Artist() string

func (*Track) FileName added in v1.0.5

func (t *Track) FileName() string

func (*Track) Load

func (t *Track) Load() error

func (*Track) Title added in v1.0.5

func (t *Track) Title() string

type TrackCollection

type TrackCollection struct {
	All []*Track
	// contains filtered or unexported fields
}

func (*TrackCollection) Find

func (t *TrackCollection) Find(id string) *Track

Find returns a track via it's ID. This is an O(1) lookup. Nil is returned if no track is found.

func (*TrackCollection) Insert

func (t *TrackCollection) Insert(audio *Track)

Insert adds a track to the collection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL