Holds the audio device and automatically disposes all finished playing sound instances.
View code on GitHub
Inheritance Hierarchy
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
The SoundDevice type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SoundDevice | Initializes a new instance of the SoundDevice class |
Methods
Name | Description | |
---|---|---|
Add T | (Inherited from Entity.) | |
AddTag | (Inherited from Entity.) | |
ClearTags | (Inherited from Entity.) | |
Contains T | (Inherited from Entity.) | |
ContainsBehavior T | (Inherited from Entity.) | |
ContainsTag | (Inherited from Entity.) | |
Deactivate | (Inherited from Entity.) | |
Dispose | (Overrides Entity Dispose .) | |
Get T |
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D)
View code on GitHub (Inherited from Entity.) | |
GetActiveBehaviors | (Inherited from Entity.) | |
GetComponentsForSaving | (Inherited from Entity.) | |
GetOrDefault T | (Inherited from Entity.) | |
GetTags | (Inherited from Entity.) | |
RapidUpdate | ||
RegisterCurrentMusic | ||
RegisterCurrentVideo | ||
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
Set | (Inherited from Entity.) | |
SetComponents | (Inherited from Entity.) | |
Start T | (Inherited from Entity.) | |
Stop T | (Inherited from Entity.) | |
ToString | (Inherited from Entity.) | |
TryLoadMusicStream |
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) |
Properties
Name | Description | |
---|---|---|
IsActive | (Inherited from Entity.) | |
IsPauseable | (Overrides Entity IsPauseable.) | |
MusicVolume | ||
NumberOfComponents | (Inherited from Entity.) | |
UpdatePriority | (Inherited from Entity.) |
Remarks
Examples
[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