Table of Contents

Class Song

Namespace
OmegaEngine.Audio
Assembly
OmegaEngine.dll

A streamed sound that is played in the background as music.

public class Song : EngineElement, IDisposable, IAudio
Inheritance
object
Song
Implements
Inherited Members

Constructors

Song(string)

A streamed sound that is played in the background as music.

public Song(string id)

Parameters

id string

The file name of the song relative to the Music content directory.

Properties

ID

The ID of this song (the file name relative to the Music content directory).

public string ID { get; }

Property Value

string

Looping

Is this sound set to loop?

public bool Looping { get; }

Property Value

bool

Playing

Is this sound currently being played?

public bool Playing { get; }

Property Value

bool

Volume

The playback volume as a factor between 0 (silent) and 1 (normal).

public float Volume { get; set; }

Property Value

float

Methods

OnDispose()

Hook that is called when the object needs to dispose its internal resources.

protected override void OnDispose()

StartPlayback(bool)

Starts the song playback

public void StartPlayback(bool looping)

Parameters

looping bool

Exceptions

FileNotFoundException

The song file could not be found.

IOException

There was a problem loading the song.

InvalidDataException

The song file does not contain valid sound data.

StopPlayback()

Stops the song playback

public void StopPlayback()