SoundBank.PlayCue Method

Plays a cue.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public void PlayCue (
         string name


Name of the cue to play.

Exception typeCondition
ArgumentNullException The name parameter is null.

Each Cue instance that you play is unique, even when playing multiple cues with the same name. This allows multiple instances of the same Cue to play simultaneously.

Calling this method does not return a Cue object. Therefore, once the cue has started playing, it cannot be controlled through any methods of Cue, such as Stop, Pause, or Resume. The cue will play until its authored end, at which point it will be released.

Because no Cue object is retrieved, cues played using this method are also unable to use Apply3D to apply 3D effects to the cue. To retrieve a cue that you can control during playback, or apply 3D effects to, use GetCue.

Xbox 360, Windows XP SP2, Windows Vista