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)

public AudioEngine(string settingsFile)

Parameters

settingsFile string

Path to a XACT settings file.

AudioEngine(string, TimeSpan, string)

public AudioEngine(string settingsFile, TimeSpan lookAheadTime, string rendererId)

Parameters

settingsFile string

Path to a XACT settings file.

lookAheadTime TimeSpan

Determines how many milliseconds the engine will look ahead when determing when to transition to another sound.

rendererId string

A string that specifies the audio renderer to use.

Remarks

For the best results, use a lookAheadTime of 250 milliseconds or greater.

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>