Class Sound
- Namespace
- OmegaEngine.Audio
- Assembly
- OmegaEngine.dll
A memory-cached sound that is played on-demand.
public class Sound : EngineElement, IDisposable, IAudio
- Inheritance
-
objectSound
- Implements
- Derived
- Inherited Members
Constructors
Sound(XSound)
Sets up a new Sound based on an XSound asset.
public Sound(XSound sound)
Parameters
Fields
Asset
A reference to the asset providing the data for this sound.
protected readonly XSound Asset
Field Value
Properties
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
ApplyVolume()
Applies the current Volume to the active playback (if any).
protected virtual void ApplyVolume()
CreatePlaybackChain(bool)
Builds the chain of sample providers feeding the mixer for a single playback.
protected virtual ISampleProvider CreatePlaybackChain(bool looping)
Parameters
loopingboolWhether the playback should loop.
Returns
- ISampleProvider
The top-level sample provider (stereo, SampleRate, IEEE-float).
OnDispose()
Hook that is called when the object needs to dispose its internal resources.
protected override void OnDispose()
StartPlayback(bool)
Starts the sound playback
public virtual void StartPlayback(bool looping)
Parameters
loopingbool
StopPlayback()
Stops the sound playback
public virtual void StopPlayback()