streamer

package
v0.0.0-...-e1971a2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStreamSeeker

func AddStreamSeeker(ss beep.StreamSeeker, id string, mixer *Synchronized, t *testing.T)

func Seek

func Seek(p int, mixer *Synchronized, t *testing.T)

Types

type Synchronized

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

Synchronized streams multiple beep.StreamSeeker synchronously, in a similar fashion as beep.Mixer. Synchronized provides methods to add and remove streamers concurrently while streaming. All streams must have the same length. Synchronized implements beep.StreamSeeker.

func NewMixer

func NewMixer() *Synchronized

func (*Synchronized) Add

func (m *Synchronized) Add(streamSeeker beep.StreamSeeker, id string) error

Add adds audio files into the playlist. Calling this method with an already loaded id.

func (*Synchronized) Err

func (m *Synchronized) Err() error

Err returns an error which occurred during streaming. If no error occurred, nil is returned. Check beep.Streamer interface for further details

func (*Synchronized) Len

func (m *Synchronized) Len() int

Len returns the total number of samples of the Streamer.

func (*Synchronized) Position

func (m *Synchronized) Position() int

Position returns the current position of the Streamer. This value is between 0 and the total length.

func (*Synchronized) Remove

func (m *Synchronized) Remove(id string)

Remove removes audio files from the playlist. It is safe to call this method with paths that don't exist in the playlist.

func (*Synchronized) Seek

func (m *Synchronized) Seek(p int) error

Seek sets the position of the Streamer to the provided value. If an error occurs during seeking, the position remains unchanged.

func (*Synchronized) Stream

func (m *Synchronized) Stream(samples [][2]float64) (n int, ok bool)

Stream copies at most len(samples) next audio samples to the samples slice. Check beep.Streamer interface for further details.

Jump to

Keyboard shortcuts

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