Sound mixer and audio management system.
load_sample(path: str | PathLike[str], predecode: bool = True) → Sampleload_sample(path: str | PathLike[str], predecode: bool = True) → SampleLoad 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(path: str | PathLike[str], predecode: bool = False) → Streamload_stream(path: str | PathLike[str], predecode: bool = False) → StreamLoad 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(volume: float) → Noneset_master_volume(volume: float) → NoneSet 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).get_master_volume() → floatget_master_volume() → floatGet the current global mixer gain.
Returns
float : Master volume (0.0 to 1.0).