Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultInputBufferFrames = 5 DefaultInputBufferMin = DefaultInputBufferFrames/2 + 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
func (*Input) SampleRate ¶
func (*Input) WriteSample ¶
func (i *Input) WriteSample(sample msdk.PCM16Sample) error
type Mixer ¶
type Mixer struct {
// contains filtered or unexported fields
}
func NewMixer ¶
func NewMixer(out msdk.Writer[msdk.PCM16Sample], bufferDur time.Duration, channels int, options ...MixerOptions) (*Mixer, error)
func (*Mixer) RemoveInput ¶
func (*Mixer) SampleRate ¶
type MixerOptions ¶
type MixerOptions func(*Mixer)
func WithInputBufferFrames ¶
func WithInputBufferFrames(frames int) MixerOptions
func WithOutputChannel ¶
func WithOutputChannel() MixerOptions
func WithOutputChannelSize ¶
func WithOutputChannelSize(size int) MixerOptions
Makes mixer write to a channel in place of directly calling out.WriteSample(), which unblocks the mixer ticker.
func WithStats ¶
func WithStats(stats *Stats) MixerOptions
type Stats ¶
type Stats struct {
Tracks atomic.Int64
TracksTotal atomic.Uint64
Restarts atomic.Uint64
TimingResets atomic.Uint64
Mixes atomic.Uint64
TimedMixes atomic.Uint64
JumpMixes atomic.Uint64
ZeroMixes atomic.Uint64
NegativeMixes atomic.Uint64
InputSamples atomic.Uint64
InputFrames atomic.Uint64
InputSamplesDropped atomic.Uint64
InputFramesDropped atomic.Uint64
MixedSamples atomic.Uint64
MixedFrames atomic.Uint64
OutputSamples atomic.Uint64
OutputFrames atomic.Uint64
WriteErrors atomic.Uint64
BlockedMixes atomic.Uint64
}
Click to show internal directories.
Click to hide internal directories.