Documentation ¶
Index ¶
- func GetDefaultMixerVolume(numMixedChannels int) volume.Volume
- type ChannelData
- type Data
- type MixBuffer
- func (m *MixBuffer) Add(pos int, rhs *MixBuffer, volMtx volume.Matrix)
- func (m *MixBuffer) C() (chan<- SampleMixIn, func())
- func (m *MixBuffer) MixInSample(d SampleMixIn)
- func (m *MixBuffer) ToIntStream(outputChannels int, samples int, bitsPerSample int, mixerVolume volume.Volume) [][]int32
- func (m *MixBuffer) ToRenderData(samples int, channels int, mixerVolume volume.Volume, ...) []byte
- func (m *MixBuffer) ToRenderDataWithBufs(outBuffers [][]byte, samples int, mixerVolume volume.Volume, ...)
- type Mixer
- func (m Mixer) Flatten(panmixer PanMixer, samplesLen int, row []ChannelData, ...) []byte
- func (m Mixer) FlattenTo(resultBuffers [][]byte, panmixer PanMixer, samplesLen int, row []ChannelData, ...)
- func (m Mixer) FlattenToInts(panmixer PanMixer, samplesLen, bitsPerSample int, row []ChannelData, ...) [][]int32
- func (m Mixer) NewMixBuffer(samples int) MixBuffer
- type PanMixer
- type SampleMixIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultMixerVolume ¶
GetDefaultMixerVolume returns the default mixer volume value based on the number of mixed channels not to be confused with the number of output channels
Types ¶
type Data ¶
type Data struct { Data MixBuffer Pan panning.Position Volume volume.Volume Pos int SamplesLen int Flush func() }
Data is a single buffer of data at a specific panning position
type MixBuffer ¶
MixBuffer is a buffer of premixed volume data intended to be eventually sent out to the sound output device after conversion to the output format
func (*MixBuffer) C ¶
func (m *MixBuffer) C() (chan<- SampleMixIn, func())
C returns a channel and a function that flushes any outstanding mix-ins and closes the channel
func (*MixBuffer) MixInSample ¶
func (m *MixBuffer) MixInSample(d SampleMixIn)
MixInSample mixes in a single sample entry into the mix buffer
func (*MixBuffer) ToIntStream ¶
func (m *MixBuffer) ToIntStream(outputChannels int, samples int, bitsPerSample int, mixerVolume volume.Volume) [][]int32
ToIntStream converts a mixbuffer into an int stream intended to be output to the output sound device
type Mixer ¶
type Mixer struct {
Channels int
}
Mixer is a manager for mixing multiple single- and multi-channel samples into a single multi-channel output stream
func (Mixer) Flatten ¶
func (m Mixer) Flatten(panmixer PanMixer, samplesLen int, row []ChannelData, mixerVolume volume.Volume, sampleFormat sampling.Format) []byte
Flatten will to a final saturation mix of all the row's channel data into a single output buffer
func (Mixer) FlattenTo ¶
func (m Mixer) FlattenTo(resultBuffers [][]byte, panmixer PanMixer, samplesLen int, row []ChannelData, mixerVolume volume.Volume, sampleFormat sampling.Format)
FlattenTo will to a final saturation mix of all the row's channel data into a single output buffer
func (Mixer) FlattenToInts ¶
func (m Mixer) FlattenToInts(panmixer PanMixer, samplesLen, bitsPerSample int, row []ChannelData, mixerVolume volume.Volume) [][]int32
FlattenToInts runs a flatten on the channel data into separate channel data of int32 variety these int32s still respect the bitsPerSample size
func (Mixer) NewMixBuffer ¶
NewMixBuffer returns a mixer buffer with a number of channels of preallocated sample data
type PanMixer ¶
PanMixer is a mixer that's specialized for mixing multichannel audio content
var PanMixerMono PanMixer = &panMixerMono{}
PanMixerMono is a mixer that's specialized for mixing monaural audio content
var PanMixerQuad PanMixer = &panMixerQuad{}
PanMixerQuad is a mixer that's specialized for mixing quadraphonic audio content
var PanMixerStereo PanMixer = &panMixerStereo{}
PanMixerStereo is a mixer that's specialized for mixing stereo audio content
func GetPanMixer ¶
GetPanMixer returns the panning mixer that can generate a matrix based on input pan value