float Volume { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Volume property of the BaseSoundComponent class represents the volume level of the sound being played by this component. It is a floating-point value that ranges from 0.0 to 1.0, where 0.0 is completely silent and 1.0 is the maximum volume.

Usage

To adjust the volume of a sound in a BaseSoundComponent, set the Volume property to a value between 0.0 and 1.0. This can be done programmatically or through the editor if the component is exposed in a user interface.

Example

// Example of setting the Volume property
BaseSoundComponent soundComponent = new BaseSoundComponent();
soundComponent.Volume = 0.75f; // Set the volume to 75% of the maximum level