Skip to content
On this page

Mixer

minispeaker.processor.mixer

master_mixer

python
def master_mixer(tracks: Dict[str,
                              Track], stopped: Event, paused: Callable[[],
                                                                       bool],
                 muted: Callable[[], bool], volume: Callable[[], float],
                 dtype: DTypeLike) -> PlaybackCallbackGeneratorType

[🔗]

Audio processor that merges multiple audio stream with master controls.

Arguments:

  • tracks Dict[str, Track] - Multiple audio streams represented as a dictionary of Tracks.
  • stopped Event - When master_mixer should end.
  • paused Callable[[], bool] - When paused is evaluated to True, no audio streams will continue.
  • muted Callable[[], bool] - When muted is evaluated to True, all audio streams will continue but will play no sound.
  • volume Callable[[], float] - Master volume.
  • dtype DTypeLike - SampleFormat equivalent of the underlying audio streams.

Returns:

  • PlaybackCallbackGeneratorType - A miniaudio compatible generator.

Yields:

  • Iterator[PlaybackCallbackGeneratorType] - Miniaudio compatible audio data.