O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The XNA Music Classes: MediaPlayer

To display music from the music library you use the XNA MediaLibrary and related classes. To actually play that music you use the static XNA MediaPlayer class.

The MediaPlayer class plays either a Song object, or all the songs in a SongCollection, or all the songs in a SongCollection beginning at a particular index. Those are the three variations of the static MediaPlayer.Play method.

You cannot create a SongCollection object yourself. You must always obtain an immutable SongCollection from one of the other classes (such as Album). This means that it’s not a simple matter to let the user select a particular subset of an album, or to rearrange the tracks in some way. That would require the program to maintain its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required