Making XACT Categories

Categories are a way of sorting audio resources into common behaviors.

Assigning sounds to categories allows the programmer to collectively change settings for similarly associated sounds. It can also ensure that a sound assigned to a category behaves according to a common set of rules, including a limit on the number of instances of sounds belonging to that category.

These are the steps to making and assigning Microsoft Cross-Platform Audio Creation Tool (XACT) categories.

Create a Category

Categories are a type of global setting, along with variables and run-time parameter controls. They are listed in the project tree at the same hierarchy level as wave banks and sound banks.

An XACT project is automatically provided with two top-level categories, the Default category, which is assigned to all sounds not explicitly assigned to any other category, and the Music category, which is intended for streamed background music.

An audio designer may create new top-level categories as required.

To create a new category

  1. Navigate to the Global Settings menu, and select New Category. You can also create a new category by pressing Ctl+T.

    Figure 1.  Creating a new category using the menu toolbar.

    The new category is listed under the Categories branch of the project tree. This new category has the default name "Category".

  2. Select the new category.

  3. Press F2 and enter a more descriptive name for the category. You can also rename a category by changing its Name property in the properties frame.

Properties

When the category is selected in the project tree, its properties are displayed in the property frame, and may be changed. The following table describes the properties of a category as they appear in the property frame.

Category Properties

When the category is selected in the project tree, its properties are displayed in the property frame, and may be changed.

Property Name Description
Name The default name of a category is Category. You can rename the catagory by changing this selection, or by selecting the name displayed in the project tree frame.
Notes Comments from the designer.
Volume The master volume level for all sounds assigned to this category. The range is from -96 dB to 6 dB.
Public If set to True, this category of sounds is available to the sound programmer (the default). If set to False, access to this category of sounds is restricted, intended for internal use by the creator of the content.

Instance-Limiting Properties

Property Name Description
LimitInstances If set to True, the number of playing instances permitted at one time within the category is limited to MaximumInstances.
MaximumInstances Specifies how many playing instances are permitted at one time within the category, if LimitInstances is set to True.
BehaviorAtMax

Specifies the action to take once the limit you specify is reached within the category. If LimitInstances is set to False, these properties are ignored. The property offers the following selection of behaviors:

  • FailToPlay — Inhibits playing of any other instances once the limit is reached. Also, the function that tried to initiate the new instance will receive a failure error code.

  • Queue — Stores the instance in a last-in-first-out queue to begin playing once any of the active instances completes.

  • Replace — Begins playing the instance in place of an active instance that meets the selected condition.

InstanceToReplace

If LimitInstances is set to True and BehaviorAtMax is set to Replace, XACT will replace the instance according to one of the following selected criteria:

  • Lowest Priority (default)
  • Oldest
  • Quietest
HowToReplace

Specifies the style of fade of a replaced instance.

  • Linear
  • Logarithmic
  • Equal Power
FadeOutDuration

The period in seconds to fade out the replaced sound.

FadeInDuration

The period in seconds to fade in the replacing sound.

Create a Subcategory

Categories may be created that are subordinate to another category.

To create a subcategory

  1. Right-click on the desired category in the project tree and select New Subcategory.

    Figure 2.  Creating a subcategory under an existing top-level category.

    The new subcategory is listed under the parent category. This new category has the default name "Category". All properties for the new subcategory are set to the defaults (properties are not copied from the parent category).

  2. Select the new subcategory.

  3. Press F2 and enter a more descriptive name for the subcategory. You can also rename a subcategory by changing its Name property in the properties frame.

Assign a Category to a Sound

Categories are useful only once they have been assigned to sounds. Once categories are assigned, they will ensure that the sounds assigned to them operate within the same functional boundaries.

For information on how to create sounds, see Working With XACT Sound Banks.

To assign a category to a sound

  1. Double-click the sound bank in the project tree to open the Sound Bank window.

  2. Drag and drop the sound you want to associate onto the desired category in the project tree.

- OR -

  1. Double-click the sound bank in the project tree to open the Sound Bank window.

  2. Select the sound you want to assign to the category.

    The sound's properties are displayed in the XACT properties frame.

  3. In the Sound Properties section, select the drop-down list of the Category property.

    The list of available categories are displayed in the drop-down list.

  4. Choose one of the available categories to set this property.

See Also

XACT Audio Authoring, XACT Overviews, XACT Reference