mixer

package
v0.3.2-beta Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mixer

type Mixer struct {
	Output chan []byte

	CurrentSongPath string
	// contains filtered or unexported fields
}

Mixer is in charge of interacting with the queue and resource cache to go from a queue of song hashes to a stream of audio data. It has logic to ensure minimal delay between songs by processing current/next in parallel. Mixer can be considered the key component that ties together all the rest

func NewMixer

func NewMixer(queue *queue.Queue, cache *cache.Cache, packetsPerSecond int) *Mixer

Packets-per-second sacrifices reliability for synchronization Higher means more synchornized streams. Minimum should be 1, super large values have undefined behaviour 2 is a reasonable default

func (*Mixer) Pause

func (m *Mixer) Pause()

Will toggle playing by preventing writes to output TODO: FiX THIS. BORKED AS HELL https://github.com/VivaLaPanda/uta-stream/issues/3 If people keep calling pause then it will keep spawning deadlocked routines until someone hits play, at which point all extra paused routines will die Need someway to check mutex or some different pause approach entirely

func (*Mixer) Play

func (m *Mixer) Play()

Will toggle playing by allowing writes to output

func (*Mixer) Skip

func (m *Mixer) Skip()

Will swap the next song in place of the current one.

Jump to

Keyboard shortcuts

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