SoundTests PlayMultipleSoundInstances Method Delta Engine Documentation

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

public void PlayMultipleSoundInstances()
Examples

[Test]
public void PlayMultipleSoundInstances()
{
    var sound = ContentLoader.Load<Sound>("DefaultSound");
    var instance1 = sound.CreateSoundInstance();
    var instance2 = sound.CreateSoundInstance();
    Assert.AreEqual(false, instance1.IsPlaying);
    instance1.Play();
    Assert.AreEqual(true, instance1.IsPlaying);
    Assert.AreEqual(false, instance2.IsPlaying);
    instance2.Volume = 0.5f;
    instance2.Panning = -1.0f;
    instance2.Play();
    Assert.AreEqual(true, instance2.IsPlaying);
}
See Also