Table of Contents

Class SoundBank

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

Represents a collection of Cues.

public class SoundBank : IDisposable
Inheritance
SoundBank
Implements
Inherited Members

Constructors

SoundBank(AudioEngine, string)

public SoundBank(AudioEngine audioEngine, string fileName)

Parameters

audioEngine AudioEngine

AudioEngine that will be associated with this sound bank.

fileName string

Path to a .xsb SoundBank file.

Properties

IsDisposed

Is true if the SoundBank has been disposed.

public bool IsDisposed { get; }

Property Value

bool

IsInUse

Is true if the SoundBank has any live Cues in use.

public bool IsInUse { get; }

Property Value

bool

Methods

Dispose()

Disposes the SoundBank.

public void Dispose()

~SoundBank()

protected ~SoundBank()

GetCue(string)

Returns a pooled Cue object.

public Cue GetCue(string name)

Parameters

name string

Friendly name of the cue to get.

Returns

Cue

a unique Cue object from a pool.

Remarks

Cue instances are unique, even when sharing the same name. This allows multiple instances to simultaneously play.

PlayCue(string)

Plays a cue.

public void PlayCue(string name)

Parameters

name string

Name of the cue to play.

PlayCue(string, AudioListener, AudioEmitter)

Plays a cue with static 3D positional information.

public void PlayCue(string name, AudioListener listener, AudioEmitter emitter)

Parameters

name string

The name of the cue to play.

listener AudioListener

The listener state.

emitter AudioEmitter

The cue emitter state.

Remarks

Commonly used for short lived effects. To dynamically change the 3D positional information on a cue over time use GetCue(string) and Apply3D(AudioListener, AudioEmitter).

Events

Disposing

This event is triggered when the SoundBank is disposed.

public event EventHandler<EventArgs> Disposing

Event Type

EventHandler<EventArgs>