🎵Аудио

using SFML.Audio;

// Registering our sound and now we can get it by key
AudioManager.RegisterSound("key", "path to wav file");

// Writing Registered Sound to the var
Sound newSound = AudioManager.GetSound("The same key that already registered");

// Starting playing sound
newSound.Play();

// Making State Flag
bool playing = true;

// Check if sound ended
while (playing) {
    if (AudioManager.IsSoundFinished("The same key that already registered"))
    {
        playing = false;
    }
}

// Saying that audio is Stopped (You can use it inside 'if')
Console.WriteLine("Sound Ended!");

Last updated