In this article I will show you how to use Album in XNA.
So lets start with what is an album and what does it do?
The Album class provides information about an album, including the album's Name, Artist, and Songs.
You can obtain an Album object through the AlbumCollection.Item indexer and the Song.Album property.
Album provides access to an album in the media library.
So you will have to work closely with MediaLibrary object.
For example you can load anything from a MediaLibrary;
MediaLibrary library = new MediaLibrary();
AlbumCollection
albums = library.Albums;
Album alb1 =
albums[0];
It may be an Album,Song or a Picture.Anthing you can call within MediaLibrary.To display them: you need to use MediaLibrary.
A Medialibrary that plays the specified song from a SongCollection:
MediaLibrary library = new MediaLibrary();
SongCollection songs
= library.Songs;
Song song =
songs[0];
MediaPlayer.Play(song);
We will create a small application that plays sample songs from an album using MediaPlayer.
//Variables
MediaLibrary sampleMediaLibrary;








junben liuPosted Jun 11, 2011, 5:40 AM
Why album come from C:\Users\Public\Music\Sample Music Have the format of the songs had requrment?