Once you have begun working on a game, you will probably want to add sound to it in the form of sound effects and background music. The tutorials on this page will help you perform the basics of doing audio in XNA. Some of the more advanced tutorials cover some special audio effects that can be performed. Also, the last tutorial covers playing .mp3 files and .wma files in XNA.
3D Audio Effects: Attenuation
16 Sep 2021
In addition to having your sound seem like it is coming from a particular location, you might also want to have your sound seem like it is farther away by being played quieter. Once again, XACT can handle this for you. This tutorial will show you how to perform attenuation based on the distance to the source of the sound.
3D Audio Effects: Location
16 Sep 2021
One of the things that XNA can do for you is to make your audio cue seem like it is coming from a particular location. For instance, if you are playing a game and you hear sounds coming from the left speaker, you know something is to your left. Doing this is fairly simple to do, and this tutorial will show you how to do it.
Playing XACT Audio
16 Sep 2021
In the previous tutorial, we created a simple XACT project. In this tutorial, we will take that XACT project and use it in an XNA game to play sound.
Using XACT
16 Sep 2021
This tutorial will show you how to create an XACT project and load audio files to create sound cues that can be played from in your XNA game. In the next tutorial, we will continue on with this project, and use it inside of an XNA game. Later we will cover some of the more advanced things you can do with XACT.
XACT Sound Loops
16 Sep 2021
One of the more common things that people want to do when playing sound is to have it repeat–often indefinitely. For instance, you will probably want your game’s background music to repeat over and over, no matter how long the game has been running for. This tutorial will show you how to set up sound cues to loop repeatedly.
Audio in XNA
15 Sep 2021
This tutorial gives some background about how audio is done in XNA. XNA, for the most part, uses the Cross-Platform Audio Creation Tool (XACT) to work with audio. It is a pretty powerful tool that comes free when you download XNA.
Audio Suggestions for Games
15 Sep 2021
There are a lot of ways that you can get audio (both music and sound effects) for your game. This tutorial discusses some of the options available that will help you avoid having to use copyrighted audio.
Background Music
15 Sep 2021
This tutorial will teach you a simple way of playing background music in an XNA game by playing them directly. This method is very similar to the previous tutorial on playing sound effects, though background music behaves a little differently.
Playing Sound Effects
15 Sep 2021
This tutorial will teach you a simple way of playing sound effects in an XNA game by playing them directly. While this method doesn’t have the same power that XACT has (which we’ll talk about later), it is much simpler to program, and works for many games.