The SoundEffectInstance Stop method is a function in the Microsoft.Xna.Framework.Audio library of the C# programming language. It is used to stop playing a sound effect instance that has been created and started with the Play() method.
Code example:
// Create a new sound effect instance SoundEffect instance = Content.Load("example_sound"); SoundEffectInstance soundEffectInstance = instance.CreateInstance();
// Start playing the sound effect instance soundEffectInstance.Play();
// Stop playing the sound effect instance soundEffectInstance.Stop();
In this example, we have created a new sound effect instance and started playing it with the Play() method. Later, we stop the sound effect instance with the Stop() method. This is useful in cases where we only want the sound effect to play for a limited duration.
Package library: Microsoft.Xna.Framework.Audio.
C# (CSharp) Microsoft.Xna.Framework.Audio SoundEffectInstance.Stop - 25 examples found. These are the top rated real world C# (CSharp) examples of Microsoft.Xna.Framework.Audio.SoundEffectInstance.Stop extracted from open source projects. You can rate examples to help us improve the quality of examples.