mix

package
v0.0.0-...-d40d5fc Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel is a special volume and pan filter, which can be connected to a mixer

func NewChannel

func NewChannel(samplerate uint32) *Channel

NewChannel creates a new Channel instance

func (*Channel) Enabled

func (ch *Channel) Enabled() bool

func (*Channel) Gain

func (ch *Channel) Gain() float32

Gain returns gain value

func (*Channel) Pan

func (ch *Channel) Pan() float32

Pan returns pan value

func (*Channel) Read

func (ch *Channel) Read(samples *snd.Samples)

func (*Channel) ReadStateless

func (ch *Channel) ReadStateless(samples *snd.Samples, freq float32, state *snd.NoteState)

func (*Channel) SetEnabled

func (ch *Channel) SetEnabled(enabled bool)

func (*Channel) SetGain

func (ch *Channel) SetGain(gain float32)

SetGain sets gain value

func (*Channel) SetPan

func (ch *Channel) SetPan(pan float32)

SetPan sets pan value

func (*Channel) SetReadable

func (ch *Channel) SetReadable(r snd.Readable)

type Mixer

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

Mixer allows the mixing of different channels

func NewMixer

func NewMixer(samplerate uint32) *Mixer

NewMixer creates a new Mixer instance

func (*Mixer) Gain

func (m *Mixer) Gain() float32

Gain returns the master gain value

func (*Mixer) GetChannel

func (m *Mixer) GetChannel() *Channel

GetChannel returns a new channel connected to this Mixer

func (*Mixer) Read

func (m *Mixer) Read(samples *snd.Samples)

func (*Mixer) ReadStateless

func (m *Mixer) ReadStateless(samples *snd.Samples, freq float32, state *snd.NoteState)

func (*Mixer) RemoveChannel

func (m *Mixer) RemoveChannel(ch *Channel)

RemoveChannel removes an existing channel from the mixer

func (*Mixer) SetGain

func (m *Mixer) SetGain(gain float32)

SetGain sets the master gain value

func (*Mixer) SetOutput

func (m *Mixer) SetOutput(out snd.Writable)

SetOutput sets the next filter in the output chain

func (*Mixer) Stop

func (m *Mixer) Stop()

Stop stops the mixer

Jump to

Keyboard shortcuts

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