Description
The GetActive
method is a static method of the SoundHandle
class. It populates a provided list with all currently active sound handles. This method is useful for retrieving a collection of all sounds that are currently playing in the application.
Usage
To use the GetActive
method, you need to pass a List<SoundHandle>
as a parameter. This list will be filled with the active sound handles when the method is called.
Ensure that the list is initialized before passing it to the method. The method does not return any value, but modifies the list in place.
Example
// Example of using the GetActive method
List<SoundHandle> activeSounds = new List<SoundHandle>();
SoundHandle.GetActive(activeSounds);
// Now activeSounds contains all currently active sound handles
foreach (var sound in activeSounds)
{
// You can now manipulate each sound handle
Console.WriteLine($"Sound Name: {sound.Name}, Volume: {sound.Volume}");
}