Music has the ability to impact the emotions of human beings. Different styles of music produce different feelings. Fast tempo music makes people feel nervous or excited; when the tempo becomes slow, people feel relaxed and safe. In modern video games, music often plays an important role in creating the atmosphere. Game designers and composers work together to tailor the music to the plot. When a player goes into a beautiful scene, a euphonious and harmonious song will accompany it; when immersed in a dangerous situation, the music will sound oppressive. In this recipe, you will learn how to use the media technology to control music in your Windows Phone 7 game.
In Windows Phone 7 XNA, a song or music is encapsulated as a Song
class. This class provides the metadata of a song and includes the song's name, artist, album, and duration. The Name
and Duration
are the most direct properties for your song. We will use them in our example. As a class design...