How To: Add a Sound File to Your Game Using XACT
For detailed information on how to author audio in the XACT tool, including information on categories, variables, and other advanced features, see XACT Audio Authoring.
To add a sound file to your game
From the Start menu, click All Programs, then click XNA Game Studio 2.0, click Tools, and finally click Microsoft Cross-Platform Audio Creation Tool (XACT).
- Start by creating a new project by clicking the File menu, then New Project. You will be asked for a location and a name for your project. Enter a name and a location you can remember, and click OK. The project will be created, and the screen will resemble the following:
- In the empty project, you must first create a wave bank. To do this, click Wave Banks, and then click New Wave Bank. A new wave bank appears in the tree view under Wave Banks with the default name "Wave Bank." Press ENTER to accept the default name.
- Create a new sound bank. To do this, click Sound Banks, and then click New Sound Bank. A new sound bank appears in the tree view under Sound Banks with the default name "Sound Bank." Press ENTER to accept the default name.
At this point, two new windows have appeared: one for the wave bank and one for the sound bank. To arrange these windows for easier viewing, click Window, and then click Tile Horizontally. The windows should now look similar to the following:
Add your wave files to the wave bank window. Make sure the wave bank window is active by clicking on it, and then click Wave Banks and click Insert Wave File(s). Insert one or more wave files into the wave bank. If you successfully added them, they appear in the wave bank window, which will look similar to the following:
For each wave listed in the wave bank window, drag the wave from the wave bank window to the sound bank window, and drop it on top of the Cue Name panel. XACT automatically creates a new cue that is linked to a new sound that plays this wave file. It should look similar to the following:
- If the lower-left corner of the sound bank window does not have any entries, you must add entries to it by dragging each sound from the upper-left panel of the sound bank to the lower left panel of the sound bank. This action creates cues that correspond to the sounds.
- Save the project. Click File, and then click Save Project.
You are now ready to load and play sounds from this project in your game. See How To: Play a Sound for information on how to do this.