Share via


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

  • song
    Song to play.

Exceptions

Exception type Condition
ArgumentNullException song is null.

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

How To: Play a Song

Reference

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

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune