float Volume { get; set; }

robot_2Generated
code_blocksInput

Description

The Volume property of the Sandbox.Audio.Mixer class is used to scale the volume of the audio output. It is a floating-point value that determines how loud the audio will be when played through this mixer.

Usage

The Volume property is a float and can be set to any value between 0 and 1, inclusive. A value of 0 will mute the audio, while a value of 1 will play the audio at its full volume. The property is decorated with the Sandbox.RangeAttribute, which enforces this range and provides a step increment of 0.01 for adjustments.

Example

// Example of setting the Volume property
Sandbox.Audio.Mixer mixer = new Sandbox.Audio.Mixer();
mixer.Volume = 0.75f; // Set the volume to 75% of the full volume