Versions in this module Expand all Collapse all v0 v0.1.0 May 9, 2026 Changes in this version + type Context struct + func NewContext(opts ...Option) (*Context, error) + func (c *Context) Channels() int + func (c *Context) Close() error + func (c *Context) NewPlayer(src io.Reader) *Player + func (c *Context) PlayWAV(data []byte) (*Player, error) + func (c *Context) SampleRate() int + type Driver interface + Close func() error + Open func(sampleRate, channels, bufferSizeMs int) error + SetSource func(src ReadFloat32er) + Start func() error + Stop func() error + type Mixer struct + func NewMixer() *Mixer + func (m *Mixer) AddSource(p *Player) + func (m *Mixer) MasterVolume() float64 + func (m *Mixer) Mix(out []float32) + func (m *Mixer) ReadFloat32s(buf []float32) (int, error) + func (m *Mixer) RemoveSource(p *Player) + func (m *Mixer) SetMasterVolume(v float64) + type NullDriver struct + func (d *NullDriver) Close() error + func (d *NullDriver) Open(_, _, _ int) error + func (d *NullDriver) SetSource(_ ReadFloat32er) + func (d *NullDriver) Start() error + func (d *NullDriver) Stop() error + type Option func(*Context) + func WithChannels(ch int) Option + func WithDriver(d Driver) Option + func WithSampleRate(rate int) Option + type Player struct + func (p *Player) IsPlaying() bool + func (p *Player) Pause() + func (p *Player) Play() + func (p *Player) Resume() + func (p *Player) SetVolume(v float64) + func (p *Player) Stop() + func (p *Player) Volume() float64 + type ReadFloat32er interface + ReadFloat32s func(buf []float32) (int, error) + type WAVDecoder struct + func DecodeWAV(data []byte) (*WAVDecoder, error) + func (d *WAVDecoder) Channels() int + func (d *WAVDecoder) Duration() time.Duration + func (d *WAVDecoder) Read(p []byte) (int, error) + func (d *WAVDecoder) Reset() + func (d *WAVDecoder) SampleRate() int