player

package
v0.0.0-...-1b074e7 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 33 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(conf *MpdConfig) *mpdPlayer

func NewOsxPlayer

func NewOsxPlayer() *osxPlayer

func NewWinMediaPlayer

func NewWinMediaPlayer() *winMediaPlayer

Types

type MpdConfig

type MpdConfig struct {
	Bin        string
	ConfigFile string
	Network    string
	Address    string
	AutoStart  bool
}

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
	structs.Song
	Type SongType
}

Jump to

Keyboard shortcuts

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