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 ofTrack
s.stopped
Event - Whenmaster_mixer
should end.paused
Callable[[], bool] - Whenpaused
is evaluated toTrue
, no audio streams will continue.muted
Callable[[], bool] - Whenmuted
is evaluated toTrue
, 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.