Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDifferentSampleRates is returned when signals with different // sample rates are sinked into mixer. ErrDifferentSampleRates = errors.New("sinking different sample rates") // ErrDifferentChannels is returned when signals with different number // of channels are sinked into mixer. ErrDifferentChannels = errors.New("sinking different channels") )
Functions ¶
Types ¶
type Asset ¶
Asset is a sink which uses a regular buffer as underlying storage. It can be used to slice signal data and use it as processing input. It's possible to use an arbitrary signal type as a buffer. Float64 is used by default.
func (*Asset) SampleRate ¶
SampleRate returns a sample rate of the asset.
func (*Asset) Sink ¶
func (a *Asset) Sink() (result pipe.SinkAllocatorFunc)
Sink uses signal.Floating buffer to store signal data.
type Mixer ¶
type Mixer struct {
// contains filtered or unexported fields
}
Mixer summs up multiple signals. It has multiple sinks and a single source.
func (*Mixer) Sink ¶
func (m *Mixer) Sink() pipe.SinkAllocatorFunc
Sink provides mixer sink allocator. Mixer sink receives a signal for mixing. Multiple sinks per mixer is allowed.
func (*Mixer) Source ¶
func (m *Mixer) Source() pipe.SourceAllocatorFunc
Source provides mixer source allocator. Mixer source outputs mixed signal. Only single source per mixer is allowed. Must be called after Sink, otherwise will panic.
type Repeater ¶
type Repeater struct {
// contains filtered or unexported fields
}
Repeater sinks the signal and sources it to multiple pipelines.
func (*Repeater) Sink ¶
func (r *Repeater) Sink() pipe.SinkAllocatorFunc
Sink must be called once per repeater.
func (*Repeater) Source ¶
func (r *Repeater) Source() pipe.SourceAllocatorFunc
Source must be called at least once per repeater.