XNA 3.0 Game Programming Recipes
Chapter 7: Adding Sounds to Your XNA 3.0 Project (12 pages)
Even the game with the best game play doesn’t feel like a lot of fun if it doesn’t have any sounds. If you add a suitable sound to your visual effects together with a background score, your game will immediately feel a lot more finished.
This short chapter shows you how easy it is to add sounds to your XNA project and to manage them.
7-1. Play and Control Simple .wav Sound Files
Since XNA 3.0, it is extremely easy to play and control sound effects in your game. This recipe gets you started in no time.
7-2. Play MP3 or WMA Sound Files
XNA 3.0 supports MP3 and WMA sound files, which you can use to add a background score to your game.
7-3. Play Simple .wav Sound Files Through XAct
This recipe introduces you to XAct the sound management utility of the XNA 3.0 Framework. You learn the simple steps on how to import sounds, and create an XAct project.
7-4. Loop Sounds
This recipe shows you how you can continuously loop one sound, which is useful for e.g. an engine. Also, you learn how you can dynamically queue up multiple sounds for a background score.
7-5. Play Sounds from a 3D Location Relative to the Camera: 3D Sound
Here you learn how sounds can be used in 3D games. You specify the location of the camera and the location of source of the sound, and XNA automatically adjusts the volume over the speakers.
- Website design & XNA + DirectX code : Riemer Grootjans -
©2003 - 2011 Riemer Grootjans