Table of Contents

Class AudioEngine

Namespace
Microsoft.Xna.Framework.Audio
Assembly
MonoGame.Framework.dll

Class used to create and manipulate code audio objects.

public class AudioEngine : IDisposable
Inheritance
AudioEngine
Implements
Inherited Members

Constructors

AudioEngine(string)

Initializes a new instance of the AudioEngine class by reading out the specified XACT settingsFile

public AudioEngine(string settingsFile)

Parameters

settingsFile string

Path to a XACT settings file.

Exceptions

ArgumentException

Invoked if settingsFile is IsNullOrEmpty(string)

AudioEngine(string, TimeSpan, string)

Initializes a new instance of the AudioEngine class by reading out the specified XACT settingsFile

[Obsolete("Use AudioEngine(string settingsFile) instead. The lookAheadTime and rendererId parameters are not used.")]
public AudioEngine(string settingsFile, TimeSpan lookAheadTime, string rendererId)

Parameters

settingsFile string

Path to a XACT settings file.

lookAheadTime TimeSpan

Not in use: use the AudioEngine(string) constructor instead!

rendererId string

Not in use: use the AudioEngine(string) constructor instead!

Fields

ContentVersion

The current content version.

public const int ContentVersion = 39

Field Value

int

Properties

IsDisposed

Is true if the AudioEngine has been disposed.

public bool IsDisposed { get; }

Property Value

bool

Methods

Dispose()

Disposes the AudioEngine.

public void Dispose()

~AudioEngine()

protected ~AudioEngine()

GetCategory(string)

Returns an audio category by name.

public AudioCategory GetCategory(string name)

Parameters

name string

Friendly name of the category to get.

Returns

AudioCategory

The AudioCategory with a matching name. Throws an exception if not found.

GetGlobalVariable(string)

Gets the value of a global variable.

public float GetGlobalVariable(string name)

Parameters

name string

Friendly name of the variable.

Returns

float

float value of the queried variable.

Remarks

A global variable has global scope. It can be accessed by all code within a project.

SetGlobalVariable(string, float)

Sets the value of a global variable.

public void SetGlobalVariable(string name, float value)

Parameters

name string

Friendly name of the variable.

value float

Value of the global variable.

Update()

Performs periodic work required by the audio engine.

public void Update()

Remarks

Must be called at least once per frame.

Events

Disposing

This event is triggered when the AudioEngine is disposed.

public event EventHandler<EventArgs> Disposing

Event Type

EventHandler<EventArgs>