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
-
objectSong
- Implements
- Inherited Members
Constructors
Song(string)
A streamed sound that is played in the background as music.
public Song(string id)
Parameters
idstringThe file name of the song relative to the
Musiccontent directory.
Properties
ID
The ID of this song (the file name relative to the Music content directory).
public string ID { get; }
Property Value
Looping
Is this sound set to loop?
public bool Looping { get; }
Property Value
Playing
Is this sound currently being played?
public bool Playing { get; }
Property Value
Volume
The playback volume as a factor between 0 (silent) and 1 (normal).
public float Volume { get; set; }
Property Value
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
loopingbool
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()