XACT Authoring Basics Tutorial

The Microsoft Cross-Platform Audio Creation Tool (XACT) is typically used by the audio designer to create an XACT project file (.xap) which is used to build the data files which the programmer will need to integrate XACT audio resources into game. Once the programmer plugs the game into XACT, the authoring tool can then be used to dynamically alter the sounds while the game is playing.

Getting Started

To get started, start the authoring tool. It should look something like this:

Figure 1.  Blank XACT Project

When you open the tool, the project is blank. There's nothing defined. To understand the XACT, you'll first need to understand some XACT terminology:

  1. A wave bank is a collection of waves logically grouped into a single file by an audio designer. When the XACT project is built for integration into a game title, each wave bank is represented by a file with the extension .xwb.
  2. A wave is just audio data. XACT supports WAV, and AIFF audio files.
  3. A sound bank is a collection of sounds and cues logically grouped by the sound designer. A sound bank file does not contain wave data; wave data resides in wave banks. A sound bank references the waves that are bundled in wave banks, and houses the information on how they are to be played. Each sound bank is represented by a file with the extension .xsb.
  4. A sound lives in a sound bank and specifies how one or more waves should be played. A sound also has specific properties such as volume and pitch. These properties can be adjusted by the sound designer. Sounds are composed of one or more tracks.
  5. A track is a grouping of events. One or more tracks define a sound. Each track can contain a single Play Wave event, as well as any number of other events (such as markers and volume changes).
  6. Events are actions to be performed within the body of a track. A track must have at least one event. The simplest event type is a Play Wave event, which plays a wave.
  7. Cues are what programmers use to play sounds. Cues are typically played when certain game events, such as footsteps or gunshots, occur. A cue is composed of one or more sounds, so when the cue is triggered, the set of associated sounds is heard.

Create Sound Banks and Wave Banks

To get started, you need to create a wave bank and a sound bank. To do this click in the menu "Wave Banks" | "New Wave Bank". A new wave bank will appear in the tree view under "Wave Banks" with the default name of "Wave Bank".

Then, create a new sound bank by clicking in the menu "Sound Banks" | "New Sound Bank". A new sound bank will appear in the tree view under "Sound Banks" with the default name of "Sound Bank". It should look like this:

Figure 2.  New Sound and Wave Banks Created

Now to make things easy to see, click "Window" | "Tile Horizontally":

Figure 3.  Windows Tiled Horizontally

Add a Wave

The wave bank window lists all the waves current inside the wave bank. Currently there are none so you will need to add some. Make sure the Wave Bank window is active by clicking on it and choose in the menu "Wave Banks" | "Insert Wave File(s)..." and insert 1 or more wave files into the wave bank. You could have also hit Ctrl-W or right clicked on the Wave Bank window for a popup menu. After you've added some wave files, they will be listed in the Wave Bank window.

Figure 4.  Wave Files Added

Make a Sound and Cue

Now that there's a wave file in the wave bank, drag this wave from the wave bank to sound bank in the "Cue Name" panel. This will make XACT automatically create a new cue that's linked to a new sound that plays to this wave file.

Figure 5.  New Cue Created

That's it! You have now setup your first complete but very simple XACT project. Now you can build this project and load the built XACT files with XACT API to play this cue in your game based on a game event. The cue we have set up will cause a single wave to be played but you can setup much more complex interactions when a cue is played.

To build the files, you will likely want to adjust build properties so the files are placed and named as you like. To do this, click on the "Wave Bank" in the tree view and adjust its "Build Name" and "Build Path" as you like and click on the "Sound Bank" in the tree view and adjust its "Build Name" and "Build Path" as you like. Then click File | "Build..." to create wave banks (*.xwb) and sound banks (*.xsb) based on the build settings.