Sound StopInstance Method Delta Engine Documentation

Namespace: DeltaEngine.Multimedia
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract void StopInstance(
	SoundInstance instanceToStop
)
Remarks

Tests: DeltaEngine.Multimedia.Tests.SoundTests
Examples

1 unit tests call DeltaEngine.Multimedia.Sound.StopInstance(DeltaEngine.Multimedia.SoundInstance)
[Test]
public void PlayAndStopInstance()
{
    var sound = ContentLoader.Load<Sound>("DefaultSound");
    var instance = sound.CreateSoundInstance();
    Assert.IsFalse(sound.IsAnyInstancePlaying);
    Assert.AreEqual(0f, instance.PositionInSeconds);
    instance.Play();
    Assert.IsTrue(sound.IsAnyInstancePlaying);
    WaitUntilSoundStateIsUpdated();
    Assert.Greater(instance.PositionInSeconds, 0f);
    sound.StopAll();
    WaitUntilSoundStateIsUpdated();
    Assert.AreEqual(0f, instance.PositionInSeconds);
    Assert.IsFalse(sound.IsAnyInstancePlaying);
}
See Also