Music DurationInSeconds Property Delta Engine Documentation

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

public abstract float DurationInSeconds { get; }

Property Value

Type: Single
Remarks

Tests: DeltaEngine.Multimedia.Tests.MusicTests
Examples

2 unit tests call DeltaEngine.Multimedia.Music.DurationInSeconds
[Test, CloseAfterFirstFrame]
public void TestIfPlayingMusic()
{
    var music = ContentLoader.Load<Music>("DefaultMusic");
    music.Play();
    Assert.IsTrue(music.IsPlaying());
    AssertBetween(4.10f, 4.15f, music.DurationInSeconds);
    AdvanceTimeAndUpdateEntities(0.5f);
    AssertBetween(0.25f, 5.0f, music.PositionInSeconds);
}
[Test, Ignore]
public void StartAndStopMusic()
{
    var music = ContentLoader.Load<Music>("DefaultMusic");
    AssertBetween(4.10f, 4.15f, music.DurationInSeconds);
    new MusicPlayedOneSecondTester(music);
    music.Play();
    Assert.IsTrue(music.IsPlaying());
}
See Also