Description
The MinRepeatTime
property of the BaseSoundComponent
class specifies the minimum time interval, in seconds, between consecutive repetitions of a sound. This property is useful when you want to control the frequency of sound playback to avoid overlapping or excessive repetition.
Usage
To use the MinRepeatTime
property, you can set it to a desired value in seconds. This value will determine the minimum time that must elapse before the sound can be repeated. It is particularly useful in scenarios where you want to ensure that a sound does not play too frequently, which can be important for maintaining audio clarity and preventing sound clutter.
Example
// Example of setting the MinRepeatTime property
BaseSoundComponent soundComponent = new BaseSoundComponent();
soundComponent.MinRepeatTime = 2.0f; // Set minimum repeat time to 2 seconds
// This ensures that the sound will not repeat more frequently than every 2 seconds.