Documentation ¶
Index ¶
- func AddStreamSeeker(ss beep.StreamSeeker, id string, mixer *Synchronized, t *testing.T)
- func Seek(p int, mixer *Synchronized, t *testing.T)
- type Synchronized
- func (m *Synchronized) Add(streamSeeker beep.StreamSeeker, id string) error
- func (m *Synchronized) Err() error
- func (m *Synchronized) Len() int
- func (m *Synchronized) Position() int
- func (m *Synchronized) Remove(id string)
- func (m *Synchronized) Seek(p int) error
- func (m *Synchronized) Stream(samples [][2]float64) (n int, ok bool)
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)
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.