Mixer

Sound mixer and audio management system.


Get Master Volume

get_master_volume() float

Get the current global mixer gain.

Returns

float : Master volume (0.0 to 1.0).

Load Sample

load_sample(path: str, predecode: bool = True) Sample

Load an audio sample (SFX) from disk.

Args

  • path : File path to load.
  • predecode : Whether to decode into memory now. Defaults to True.

Returns

Sample : The loaded audio object.

Load Stream

load_stream(path: str, predecode: bool = False) Stream

Load an audio stream (Music) from disk.

Args

  • path : File path to load.
  • predecode : Whether to decode into memory now. Defaults to False.

Returns

Stream : The loaded audio object.

Set Master Volume

set_master_volume(volume: SupportsFloat) None

Set the global mixer gain.

This affects all playing samples and streams. Individual audio volume is multiplied by this value. Default is 1.0.

Args

  • volume : Master volume scalar (0.0 to 1.0).