Great games have appealing background music. Now, we are going to search and add background music to our game: NoteAs with other digital content, sound and music have a copyright owner and a license. Hence, we must be very careful when downloading sound and music for our games. We must read licenses before deploying our games with these digital contents embedded.
You discovered that the speakers worked! Now, the game has attractive background music. Leave the speakers on, because your project manager wants more sound effects in the game. We created a new LayoutRoot.Children.Add(backgroundMusic); Then, we defined the desired backgroundMusic.Volume = 0.8; backgroundMusic.Source = new Uri("Media/distorted_velocity._1.mp3", UriKind.Relative); The The first parameter for the new Once we set up all the necessary parameters, we called the backgroundMusic.Play(); The code goes on running while the music file is being played. Hence, the game starts and we can still hear the music. |