Demonstrates how to add wave (.WAV) files to an XACT project that can be built and interpreted by an XNA Game Studio game to play audio.
For detailed information about how to author audio in the XACT tool, including information on categories, variables, and other advanced features, see XACT Audio Authoring.
Adding a Sound File to Your Game
To create a wave bank and a sound bank
-
From the Start menu, click All Programs, click XNA Game Studio 3.0, click Tools, and then click Microsoft Cross-Platform Audio Creation Tool (XACT).
-
To create a new project, click the File menu, and then click New Project.
You will be asked for a location and a name for your project.
-
Enter a name and a location that is easy for you to remember, and click OK.
The project will be created, and the screen will resemble the following:
-
In the empty project, 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.
-
To create a new sound bank, 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:
To add wave files to the wave bank window
Now you need to add your wave file to the wave bank window.
-
To make sure the wave bank window is active, click Wave Banks, and then click Insert Wave File(s).
-
Insert one or more wave files into the wave bank.
If you successfully added them, they will look similar to the following wave bank window:
Now you need to perform the following step for each wave listed in the wave bank window.
-
For each wave listed in the wave bank window, drag the wave from the wave bank window to the sound bank window, and then drop the wave 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, 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.
-
To save the project, click File, and then click Save Project.
-
Click File, and then Build… to build your 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.