Table of Contents

Class Sound

Namespace
OmegaEngine.Audio
Assembly
OmegaEngine.dll

A memory-cached sound that is played on-demand.

public class Sound : EngineElement, IDisposable, IAudio
Inheritance
Sound
Implements
Derived
Inherited Members
Extension Methods

Constructors

Sound(XSound)

Sets up a new Sound based on an XSound asset.

public Sound(XSound sound)

Parameters

sound XSound

The XSound asset to get the audio data from.

Fields

Asset

A reference to the asset providing the data for this sound.

protected readonly XSound Asset

Field Value

XSound

SoundBuffer

The sound buffer containing the decoded data ready for playback.

protected SecondarySoundBuffer SoundBuffer

Field Value

SecondarySoundBuffer

Properties

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 for the asset.

public int Volume { get; set; }

Property Value

int

Methods

OnDispose()

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

protected override void OnDispose()

OnEngineSet()

Hook that is called when Engine is set for the first time.

protected override void OnEngineSet()

StartPlayback(bool)

Starts the sound playback

public virtual void StartPlayback(bool looping)

Parameters

looping bool

StopPlayback()

Stops the sound playback

public virtual void StopPlayback()