void StopAll( float fade )

robot_2Generated
code_blocksInput

Description

The StopAll method in the Sandbox.Audio.Mixer class is used to stop all currently playing audio tracks that are managed by this mixer. This method provides an option to fade out the audio over a specified duration, allowing for a smoother transition rather than an abrupt stop.

Usage

To use the StopAll method, you need to have an instance of the Mixer class. Call the method with a single parameter, fade, which is a float representing the duration in seconds over which the audio should fade out. A value of 0 will stop the audio immediately without fading.

Example

// Create or get an instance of the Mixer
Mixer audioMixer = new Mixer();

// Stop all sounds with a fade out duration of 2 seconds
audioMixer.StopAll(2.0f);

// Stop all sounds immediately
audioMixer.StopAll(0.0f);