Namespace: DeltaEngine.Multimedia
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Multimedia.Tests.SoundTests
3 unit tests call DeltaEngine.Multimedia.Sound.IsAnyInstancePlaying
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: BooleanRemarks
Examples
[Test] public void PlayAndStop() { var sound = ContentLoader.Load<Sound>("DefaultSound"); Assert.IsFalse(sound.IsAnyInstancePlaying); sound.Play(); Assert.IsTrue(sound.IsAnyInstancePlaying); sound.StopAll(); WaitUntilSoundStateIsUpdated(); Assert.IsFalse(sound.IsAnyInstancePlaying); sound.Play(); }
[Test] public void PlayAndStopEvents() { var sound = ContentLoader.Load<Sound>("DefaultSound"); sound.OnPlay += instance => Assert.True(sound.IsAnyInstancePlaying); sound.OnStop += instance => Assert.False(sound.IsAnyInstancePlaying); sound.Play(); sound.StopAll(); WaitUntilSoundStateIsUpdated(); }
[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