player

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSong

func DecodeSong(t SongType, r io.ReadSeekCloser) (streamer beep.StreamSeekCloser, format beep.Format, err error)

func ModeName

func ModeName(mode Mode) string

Types

type MediaAsset

type MediaAsset struct {
	arc.MediaAsset
	SongInfo spotify.FullTrack
}

func (MediaAsset) Duration

func (m MediaAsset) Duration() time.Duration

func (MediaAsset) SongType

func (m MediaAsset) SongType() SongType

type Mode

type Mode uint8

Mode play mode

const (
	PmListLoop Mode = iota + 1
	PmOrder
	PmSingleLoop
	PmRandom
)

type Player

type Player interface {
	Play(music MediaAsset)
	CurMusic() MediaAsset
	Paused()
	Resume()
	Stop()
	Toggle()
	Seek(duration time.Duration)
	PassedTime() time.Duration
	TimeChan() <-chan time.Duration
	State() State
	StateChan() <-chan State
	Volume() int
	SetVolume(volume int)
	UpVolume()
	DownVolume()
	Close()
}

func NewBeepPlayer

func NewBeepPlayer() Player

func NewOsxPlayer

func NewOsxPlayer() Player

func NewPlayerFromConfig

func NewPlayerFromConfig() Player

type SongType

type SongType uint8
const (
	Mp3 SongType = iota
	Ogg
	Aac
)

type State

type State uint8
const (
	Unknown State = iota
	Playing
	Paused
	Stopped
	Interrupted
)

Jump to

Keyboard shortcuts

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