Documentation ¶
Overview ¶
Package player provides a simple audio player based on Takeout server-based playlists. There's support for FLAC, OGG, MP3 and WAV audio decoding, along with Internet radio and ICY metadata. Internally Beep and Oto are used which are known to work on Linux, BSDs, macOS, Windows, and more.
Index ¶
- Constants
- Variables
- func Notify(streamer beep.StreamSeekCloser, halfway NotifyFunc) *notify
- type Config
- type Icy
- type IcyHeaders
- type IcyMetadata
- type NotifyFunc
- type Player
- func (p *Player) Album() string
- func (p *Player) Artist() string
- func (p *Player) Context() client.Context
- func (p *Player) ETag() string
- func (p *Player) Image() string
- func (p *Player) Index() int
- func (p *Player) IsMusic() bool
- func (p *Player) IsPodcast() bool
- func (p *Player) IsStream() bool
- func (p *Player) Length() int
- func (p *Player) Next()
- func (p *Player) Pause()
- func (p *Player) Position() (time.Duration, time.Duration)
- func (p *Player) SkipBackward()
- func (p *Player) SkipForward()
- func (p *Player) Start()
- func (p *Player) Stop()
- func (p *Player) Title() string
- func (p *Player) Track() (string, string, string, string)
Constants ¶
View Source
const ( ActionNext playerAction = iota ActionSkipForward ActionSkipBackward ActionPause ActionStop )
Variables ¶
View Source
var ( ErrInvalidMetadataLength = errors.New("icy metadata length is invalid") ErrInvalidIntervalLength = errors.New("icy metadata interval is invalid") HeaderIcyBr = http.CanonicalHeaderKey("Icy-Br") HeaderIcyDescription = http.CanonicalHeaderKey("Icy-Description") HeaderIcyGenre = http.CanonicalHeaderKey("Icy-Genre") HeaderIcyMetaData = http.CanonicalHeaderKey("Icy-MetaData") HeaderIcyMetaInt = http.CanonicalHeaderKey("Icy-MetaInt") HeaderIcyName = http.CanonicalHeaderKey("Icy-Name") HeaderIcyPublic = http.CanonicalHeaderKey("Icy-Pub") HeaderIcyUrl = http.CanonicalHeaderKey("Icy-Url") )
Functions ¶
func Notify ¶ added in v0.11.4
func Notify(streamer beep.StreamSeekCloser, halfway NotifyFunc) *notify
Types ¶
type Config ¶
type Icy ¶
type Icy struct { OnMetadata func(IcyMetadata) // contains filtered or unexported fields }
func NewIcyReader ¶
func NewIcyReader(interval int, reader io.ReadCloser, onMetaData func(IcyMetadata)) *Icy
type IcyHeaders ¶
type IcyMetadata ¶
type NotifyFunc ¶ added in v0.11.4
type NotifyFunc func()
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) SkipBackward ¶ added in v0.11.3
func (p *Player) SkipBackward()
func (*Player) SkipForward ¶ added in v0.11.3
func (p *Player) SkipForward()
Click to show internal directories.
Click to hide internal directories.