SoundDevice ClassDelta Engine Documentation
Holds the audio device and automatically disposes all finished playing sound instances. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Multimedia SoundDevice
      DeltaEngine.Multimedia.BaseOpenAL OpenALSoundDevice
      DeltaEngine.Multimedia.Mocks MockSoundDevice
      DeltaEngine.Multimedia.SharpDX XAudioDevice
      DeltaEngine.Multimedia.SlimDX XAudioDevice
      DeltaEngine.Multimedia.Xna XnaSoundDevice

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

public abstract class SoundDevice : Entity, 
	RapidUpdateable

The SoundDevice type exposes the following members.

Constructors

  NameDescription
Protected methodSoundDevice
Initializes a new instance of the SoundDevice class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Overrides Entity Dispose .)
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Public methodRapidUpdate
Public methodRegisterCurrentMusic
Public methodRegisterCurrentVideo
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Public methodTryLoadMusicStream
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Top
Properties

  NameDescription
Public propertyIsActive (Inherited from Entity.)
Public propertyIsPauseable (Overrides Entity IsPauseable.)
Public propertyMusicVolume
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyUpdatePriority (Inherited from Entity.)
Top
Remarks

Tests: DeltaEngine.Multimedia.Tests.SoundDeviceTests
Examples

6 unit tests call DeltaEngine.Multimedia.SoundDevice
[Test]
public void PlayMusicWhileOtherIsPlaying()
{
    var music1 = ContentLoader.Load<Music>("DefaultMusic");
    var music2 = ContentLoader.Load<Music>("DefaultMusicBackwards");
    music1.Play();
    if (IsMockResolver)
        Assert.False(MockMusic.MusicStopCalled);
    music2.Play();
    if (IsMockResolver)
        Assert.True(MockMusic.MusicStopCalled);
}
[Test]
public void RunWithVideoAndMusic()
{
    var video = ContentLoader.Load<Video>("DefaultVideo");
    var music = ContentLoader.Load<Music>("DefaultMusic");
    video.Play();
    music.Play();
}
[Test]
public void TestIfPLayingMusic()
{
    var video = ContentLoader.Load<Video>("DefaultVideo");
    video.Play();
    Assert.IsTrue(video.IsPlaying());
    Assert.AreEqual(3.33333325f, video.DurationInSeconds);
    Assert.AreEqual(1.0f, video.PositionInSeconds);
}
See Also