int Decibels { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Decibels property of the SoundEvent class represents the loudness of a sound, which affects how far away it can be heard. However, this property is marked as obsolete and is not used anymore. It is recommended to use other properties such as Volume to control the loudness of a sound.

Usage

Since the Decibels property is obsolete, it should not be used in new code. Instead, consider using the Volume property to adjust the loudness of a sound event. The Volume property provides a more flexible and current approach to managing sound levels.

Example

// Example of using the Volume property instead of Decibels
SoundEvent soundEvent = new SoundEvent();
soundEvent.Volume = new RangedFloat(0.5f, 0.8f); // Set volume range

// Note: Avoid using the obsolete Decibels property
// soundEvent.Decibels = 75; // This is obsolete and should not be used