player

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Channels = 2
View Source
const DisableCheckMediaRestricted = true
View Source
const MaxStateVolume = 65535
View Source
const SampleRate = 44100

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type EventType
}

type EventType

type EventType int
const (
	EventTypePlaying EventType = iota
	EventTypePaused
	EventTypeStopped
	EventTypeNotPlaying
)

type Player

type Player struct {
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(sp *spclient.Spclient, audioKey *audio.KeyProvider, normalisationEnabled bool, normalisationPregain float32, countryCode *string, device, mixer string, control string, volumeSteps uint32, externalVolume bool, externalVolumeUpdate *output.RingBuffer[float32]) (*Player, error)

func (*Player) Close

func (p *Player) Close()

func (*Player) HasBeenPlayingFor

func (p *Player) HasBeenPlayingFor() time.Duration

func (*Player) NewStream

func (p *Player) NewStream(spotId librespot.SpotifyId, bitrate int, mediaPosition int64) (*Stream, error)

func (*Player) Pause

func (p *Player) Pause() error

func (*Player) Play

func (p *Player) Play() error

func (*Player) PositionMs

func (p *Player) PositionMs() int64

func (*Player) Receive

func (p *Player) Receive() <-chan Event

func (*Player) SeekMs

func (p *Player) SeekMs(pos int64) error

func (*Player) SetPrimaryStream

func (p *Player) SetPrimaryStream(source librespot.AudioSource, paused, drop bool) error

func (*Player) SetSecondaryStream

func (p *Player) SetSecondaryStream(source librespot.AudioSource)

func (*Player) SetVolume

func (p *Player) SetVolume(val uint32)

func (*Player) Stop

func (p *Player) Stop()

type Stream

type Stream struct {
	Source librespot.AudioSource
	Media  *librespot.Media
	File   *metadatapb.AudioFile
}

func (*Stream) Is

func (s *Stream) Is(id librespot.SpotifyId) bool

type SwitchingAudioSource

type SwitchingAudioSource struct {
	// contains filtered or unexported fields
}

func NewSwitchingAudioSource

func NewSwitchingAudioSource() *SwitchingAudioSource

func (*SwitchingAudioSource) Close

func (s *SwitchingAudioSource) Close() error

func (*SwitchingAudioSource) Done

func (s *SwitchingAudioSource) Done() <-chan struct{}

func (*SwitchingAudioSource) PositionMs

func (s *SwitchingAudioSource) PositionMs() int64

func (*SwitchingAudioSource) Read

func (s *SwitchingAudioSource) Read(p []float32) (n int, err error)

func (*SwitchingAudioSource) SetPositionMs

func (s *SwitchingAudioSource) SetPositionMs(pos int64) error

func (*SwitchingAudioSource) SetPrimary

func (s *SwitchingAudioSource) SetPrimary(source librespot.AudioSource)

func (*SwitchingAudioSource) SetSecondary

func (s *SwitchingAudioSource) SetSecondary(source librespot.AudioSource)

Jump to

Keyboard shortcuts

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