Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Paradox.Audio.AudioEngine Class Reference

Represents the audio engine. In current version, the audio engine necessarily creates its context on the default audio hardware of the device. The audio engine is required when creating or loading sounds. More...

Inheritance diagram for SiliconStudio.Paradox.Audio.AudioEngine:
SiliconStudio.Core.ComponentBase SiliconStudio.Core.IComponent SiliconStudio.Core.ICollectorHolder SiliconStudio.Core.IReferencable SiliconStudio.Core.IReferencable

Public Member Functions

 AudioEngine (uint sampleRate=0)
 Create an Audio Engine on the default audio device More...
 
void Update ()
 Method that updates all the sounds play status. More...
 
void PauseAudio ()
 Pause the audio engine. That is, pause all the currently playing SoundInstanceBase, and block any future play until ResumeAudio is called. More...
 
void ResumeAudio ()
 Resume all audio engine. That is, resume the sounds paused by PauseAudio, and re-authorize future calls to play. More...
 
SoundEffect GetLeastSignificativeSoundEffect ()
 Return the SoundEffect evaluated as having least impact onto the final audio output among all the non stopped SoundEffect. More...
 
- Public Member Functions inherited from SiliconStudio.Core.ComponentBase
void Dispose ()
 
override string ToString ()
 

Static Public Attributes

static readonly Logger Logger = GlobalLogger.GetLogger("AudioEngine")
 The logger of the audio engine. More...
 

Protected Member Functions

override void Destroy ()
 Disposes of object resources. More...
 
- Protected Member Functions inherited from SiliconStudio.Core.ComponentBase
 ComponentBase ()
 Initializes a new instance of the ComponentBase class. More...
 
 ComponentBase (string name)
 Initializes a new instance of the ComponentBase class. More...
 
virtual void OnNameChanged ()
 Called when Name property was changed. More...
 

Properties

AudioEngineState State [get, set]
 The current state of the AudioEngine. More...
 
- Properties inherited from SiliconStudio.Core.ComponentBase
long Id [get, set]
 
string Name [get, set]
 Gets or sets the name of this component. More...
 
bool IsDisposed [get, set]
 Has the component been disposed or not yet. More...
 
- Properties inherited from SiliconStudio.Core.IComponent
long Id [get]
 Gets the id of this component. More...
 
string Name [get]
 Gets the name of this component. More...
 
- Properties inherited from SiliconStudio.Core.IReferencable
int ReferenceCount [get]
 Gets the reference count of this instance. More...
 
- Properties inherited from SiliconStudio.Core.ICollectorHolder
ObjectCollector Collector [get]
 Gets the collector. More...
 

Additional Inherited Members

- Public Attributes inherited from SiliconStudio.Core.ComponentBase
PropertyContainer Tags
 Gets the attached properties to this component. More...
 

Detailed Description

Represents the audio engine. In current version, the audio engine necessarily creates its context on the default audio hardware of the device. The audio engine is required when creating or loading sounds.

The AudioEngine is Disposable. Call the ComponentBase.Dispose function when you do not need to play sounds anymore to free memory allocated to the audio system. A call to Dispose automatically stops and disposes all the SoundEffect, SoundEffectInstance and DynamicSoundEffectInstance sounds created by this AudioEngine

See also
SoundEffect.Load, SoundMusic.Load, DynamicSoundEffectInstance

Definition at line 80 of file AudioEngine.cs.

Constructor & Destructor Documentation

SiliconStudio.Paradox.Audio.AudioEngine.AudioEngine ( uint  sampleRate = 0)

Create an Audio Engine on the default audio device

Parameters
sampleRateThe desired sample rate of the audio graph. 0 let the engine choose the best value depending on the hardware.
Exceptions
AudioInitializationExceptionInitialization of the audio engine failed. May be due to memory problems or missing audio hardware.

Definition at line 92 of file AudioEngine.cs.

Member Function Documentation

override void SiliconStudio.Paradox.Audio.AudioEngine.Destroy ( )
protectedvirtual

Disposes of object resources.

Reimplemented from SiliconStudio.Core.ComponentBase.

Definition at line 285 of file AudioEngine.cs.

SoundEffect SiliconStudio.Paradox.Audio.AudioEngine.GetLeastSignificativeSoundEffect ( )

Return the SoundEffect evaluated as having least impact onto the final audio output among all the non stopped SoundEffect.

Returns
An instance of SoundEffect currently playing or paused, or null if no candidate

Definition at line 214 of file AudioEngine.cs.

void SiliconStudio.Paradox.Audio.AudioEngine.PauseAudio ( )

Pause the audio engine. That is, pause all the currently playing SoundInstanceBase, and block any future play until ResumeAudio is called.

Definition at line 158 of file AudioEngine.cs.

void SiliconStudio.Paradox.Audio.AudioEngine.ResumeAudio ( )

Resume all audio engine. That is, resume the sounds paused by PauseAudio, and re-authorize future calls to play.

Definition at line 194 of file AudioEngine.cs.

void SiliconStudio.Paradox.Audio.AudioEngine.Update ( )

Method that updates all the sounds play status.

Should be called in same thread as user main thread.

Exceptions
InvalidOperationExceptionOne or several of the sounds asked for play had invalid data (corrupted or unsupported formats).

Definition at line 145 of file AudioEngine.cs.

Member Data Documentation

readonly Logger SiliconStudio.Paradox.Audio.AudioEngine.Logger = GlobalLogger.GetLogger("AudioEngine")
static

The logger of the audio engine.

Definition at line 85 of file AudioEngine.cs.

Property Documentation

AudioEngineState SiliconStudio.Paradox.Audio.AudioEngine.State
getset

The current state of the AudioEngine.

Definition at line 153 of file AudioEngine.cs.

Referenced by SiliconStudio.Paradox.Audio.SoundInstanceBase.PlayExtended().


The documentation for this class was generated from the following file: