Function mixer

Source
pub fn mixer(
    channels: ChannelCount,
    sample_rate: SampleRate,
) -> (Mixer, MixerSource)
Expand description

Builds a new mixer.

You can choose the characteristics of the output thanks to this constructor. All the sounds added to the mixer will be converted to these values.

After creating a mixer, you can add new sounds with the controller.

Note that mixer without any input source behaves like an Empty (not: Zero) source, and thus, just after appending to a sink, the mixer is removed from the sink. As a result, input sources added to the mixer later might not be forwarded to the sink. Add Zero source to prevent detaching the mixer from sink.