Interactive Audio is a feature of the Microsoft Cross-Platform Audio Creation Tool (XACT) which enables controlled transitions between sounds or music. A complex set of music transitions can be controlled at run-time with a single trigger variable, set by the game, which causes sound transitions to occur. The transition states, effects, delays, and so on, are handled automatically by the XACT engine. Multiple interactive cues can be playing at one time, based from the same or different trigger variables, enabling a rich combination of transitions. For example, crowd noises could transition between frantic cheering, booing, and stunned silence, while the background music transitions between scores, both based on the ebb and flow of a battle scene.
To enable Interactive Audio, set the IsInteractive property of a cue to True. Cue properties can be set by selecting the cue in the Sound Bank window, then selecting the property in the property pane.
A transition occurs when the XACT engine picks a new variation to play from an interactive audio cue. Note that if the same variation is picked again, no transition occurs and the variation continues playing uninterrupted. To edit transitions, right-click on a cue and select Edit Transitions. This will open the Interactive Audio window. You may then choose to view the transition properties by source or by target. The following properties appear in the property frame.
Transition Property | Description | Possible Values |
---|---|---|
TransitionSource | When in the currently playing sound to begin the transition. |
Immediate (default) - Stop this sound at any point and start transition. First Marker within Range - Wait to leave this sound until the first marker in the specified range (low, high) is reached. If no marker is reached in the range, transition immediately. Random Marker from Range - Wait to leave this sound until a randomly chosen marker in this range is reached. If no marker is reached in the range, transition immediately. End of Loop - Play to the end of the loop (either looping play event or loop start event) then start the transition. If no loop play to the end of the sound. End of Sound - Play to the end of the sound then start the transition. If the sound playing loops infinitely, the transition will occur immediately. |
SourceMarkerMin | The minimum value of the marker range. |
0 to 4,294,967,295 |
SourceMarkerMax | The maximum value of the marker range. |
0 to 4,294,967,295 |
FadeOutDuration | The duration, in milliseconds, to fade out the source sound. |
0 to 65.535 |
TransitionDestination | When in the destination sound to begin playing. |
Beginning (default) — Start the destination sound from the beginning (timestamp 0.0). AlignedTime — Jump to the same time in the destination that we were at in the source (effectively allow for smooth crossfading between several potential mixes). AlignedMarker — Jump to the same instance of a marker that shares the same value as the marker we left the source sound at. FirstAlignedMarker — Jump to the first instance of a marker that shares the same value as the marker we left the source sound at. If there is no matching marker, start from the beginning. FirstMarkerInRange — Start playing at the first marker encountered in the destination sound in the specified range. If none is found, start from beginning. RandomMarkerInRange — Start playing at a randomly chosen marker within the specified range. If none is found, start from beginning. |
DestinationMarkerMin | The minimum value of the marker range. |
0 to 4,294,967,295 |
DestinationMarkerMax | The maximum value of the marker range. |
0 to 4,294,967,295 |
FadeInDuration | The duration, in milliseconds, to fade in the destination sound. |
0 to 65.535 |
TransitionType | How to get from the source to the destination. |
See Transition Behavior. |
TransitionSound | The sound to play between the source and destination. |
<none> or the name of the sound to play. |
CrossfadeType | How the destination should replace the source sound. |
Linear — Crossfade should be linear. Logarithmic — Crossfade should be logarithmic. EqualPower — Crossfade should be equal power. |
The following tables display the possible source, destination and transition values and their defined behavior for the Transition Type property defined in the previous table.
Transition Effect | Description | Parameters |
---|---|---|
None (default) | No transition, just start the Destination as specified. | None. |
Crossfade | Crossfade the Source and the Destination based on the parameters. |
Source Fade Out — The time to fade the Source, in seconds. Destination Fade In — The time to fade in the Destination, in seconds. |
Transitional Sound | Play the transitional sound specified when the Source stops. When the transitional sound stops, start the Destination sound, possibly overlapped with a crossfade listed below. |
Transitional Sound — The sound chosen to be played between the end of the Source and the beginning of the Destination. Simultaneous — True or False. If True, play the transitional sound and the Destination at the same time. |
Crossfade to Transitional Sound | Crossfade from the Source to the transitional sound. When the transition sound is done, begin playing the Destination. |
Source Fade Out — The time to fade the Source, in seconds. Transitional Sound — The sound chosen to be played between the end of the Source and the beginning of the Destination. |
Crossfade from Transitional Sound | Begin the transition sound once the Source has stopped. Crossfade from the transition sound to the Destination. (No change for simultaneous start; destination can still crossfade in, even though transition does not.) |
Destination Fade In — The time to fade in the Destination, in seconds. Transitional Sound — The sound chosen to be played between the end of the Source and the beginning of the Destination. |
Crossfade to/from transitional sound | Crossfade from the Source to the transitional sound and from the transitional sound to the Destination. |
Source Fade Out — The time to fade the Source, in seconds. Transitional Sound — The sound chosen to be played between the end of the Source and the beginning of the Destination. Destination Fade In — The time to fade in the Destination, in seconds. |
To audition a cue with interactive audio properties, simply select the cue in the sound bank and click on the play button in the XACT toolbar. To change the variable value while auditioning, open the variables window and adjust the slider for the interactive audio variable. For now when you try to edit transition properties while auditioning, the auditioning will stop (transition table has to be regenerated). Play the cue when the Transition window has focus by clicking the play button on the toolbar.