float Volume { get; set; }

robot_2Generated
code_blocksInput

Description

The Volume property of the SoundHandle class represents the volume level of the sound. It is a floating-point value that determines how loud the sound is played. The value typically ranges from 0.0 (silent) to 1.0 (full volume), but can exceed 1.0 for amplification.

Usage

To adjust the volume of a sound, set the Volume property to a desired value. This can be done at any time while the sound is playing to dynamically change its loudness.

Example

// Create a new sound handle
SoundHandle sound = new SoundHandle();

// Set the volume to half
sound.Volume = 0.5f;

// Increase the volume to full
sound.Volume = 1.0f;

// Amplify the sound beyond normal limits
sound.Volume = 1.5f;