mux

package
v3.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mux offers APIs for a low-level multiplexer of audio players. Usually you don't have to use this.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format int
const (
	FormatFloat32LE     Format = 0
	FormatUnsignedInt8  Format = 1 // This must be 1 for backward compatibility during v2.
	FormatSignedInt16LE Format = 2 // This must be 2 for backward compatibility during v2.
)

func (Format) ByteLength

func (f Format) ByteLength() int

type Mux

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

Mux is a low-level multiplexer of audio players.

func New

func New(sampleRate int, channelCount int, format Format) *Mux

New creates a new Mux.

func (*Mux) NewPlayer

func (m *Mux) NewPlayer(src io.Reader) *Player

func (*Mux) ReadFloat32s

func (m *Mux) ReadFloat32s(buf []float32)

ReadFloat32s fills buf with the multiplexed data of the players as float32 values.

type Player

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

func (*Player) Close

func (p *Player) Close() error

func (*Player) Err

func (p *Player) Err() error

func (*Player) IsPlaying

func (p *Player) IsPlaying() bool

func (*Player) Pause

func (p *Player) Pause()

func (*Player) Play

func (p *Player) Play()

func (*Player) Reset

func (p *Player) Reset()

func (*Player) Seek

func (p *Player) Seek(offset int64, whence int) (int64, error)

func (*Player) SetBufferSize

func (p *Player) SetBufferSize(bufferSize int)

func (*Player) SetVolume

func (p *Player) SetVolume(volume float64)

func (*Player) UnplayedBufferSize

func (p *Player) UnplayedBufferSize() int

func (*Player) Volume

func (p *Player) Volume() float64

Jump to

Keyboard shortcuts

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