player

package
v0.0.0-...-87db3fa Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SongTypeMapping = map[string]SongType{
	"mp3":  Mp3,
	"wav":  Wav,
	"ogg":  Ogg,
	"flac": Flac,
}

Functions

func DecodeSong

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

func NewBeepPlayer

func NewBeepPlayer() *beepPlayer

func NewMpdPlayer

func NewMpdPlayer(bin, configFile, network, address string) *mpdPlayer

func NewOsxPlayer

func NewOsxPlayer() *osxPlayer

func NewWinMediaPlayer

func NewWinMediaPlayer() *winMediaPlayer

Types

type Player

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

func NewPlayerFromConfig

func NewPlayerFromConfig() Player

type SongType

type SongType uint8

SongType 歌曲类型

const (
	Mp3 SongType = iota
	Wav
	Ogg
	Flac
)

type UrlMusic

type UrlMusic struct {
	Url  string
	Type SongType
	structs.Song
}

Jump to

Keyboard shortcuts

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