mux

package
v3.0.0-...-671afc8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 6 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

Format must sync with oto's Format.

const (
	FormatFloat32LE Format = iota
	FormatUnsignedInt8
	FormatSignedInt16LE
)

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 []int16)

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) BufferedSize

func (p *Player) BufferedSize() int

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) Volume

func (p *Player) Volume() float64

Jump to

Keyboard shortcuts

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