Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Camera
Color
Draw
Ease
Event
Fx
Gamepad
Input
Log
Math
Mixer
Mouse
Physics
Pixel Array
Renderer
Shaders
Time
Transform
Ui
Viewport
Window

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Functions
  3. Mixer

Mixer

Sound mixer and audio management system.


Load Sample

load_sample(path: str | PathLike[str], predecode: bool = True) → Sampleload_sample(path: str | PathLike[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 | PathLike[str], predecode: bool = False) → Streamload_stream(path: str | PathLike[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: float) → Noneset_master_volume(volume: float) → 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).

Get Master Volume

get_master_volume() → floatget_master_volume() → float

Get the current global mixer gain.

Returns

float : Master volume (0.0 to 1.0).

PreviousMath
NextMouse

On this page

Load SampleLoad StreamSet Master VolumeGet Master Volume