MediaPlayer.Play Method (Song)

Plays a Song.

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

Syntax

public static void Play (
         Song song
)

Parameters

Exceptions

Exception type Condition
ArgumentNullException song is null.
InvalidOperationException Song playback failed.

Remarks

Play clears the current playback queue, and then queues up the specified song for playback. Playback starts immediately at the beginning of the song.

See Also

Tasks

Playing a Song

Reference

MediaPlayer.Play Method
MediaPlayer Class
MediaPlayer Members
Microsoft.Xna.Framework.Media Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone