bool IsLoaded { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsLoaded property of the SoundFile class indicates whether the sound file has been successfully loaded into memory. This property returns a boolean value: true if the sound is loaded, and false otherwise.

Usage

Use the IsLoaded property to check if a sound file is ready for operations that require the sound data to be available in memory. This is particularly useful to ensure that the sound file is fully loaded before attempting to play it or access its samples.

Example

// Example of using the IsLoaded property
SoundFile sound = SoundFile.Load("path/to/soundfile.wav");

if (sound.IsLoaded)
{
    // Proceed with operations that require the sound to be loaded
    Console.WriteLine("Sound is loaded and ready to use.");
}
else
{
    // Handle the case where the sound is not loaded
    Console.WriteLine("Sound is not loaded.");
}