Share via


Identifying XACT Implementation Differences on Microsoft Windows and Xbox 360

By Scott Selfon, Senior Audio Specialist

Advanced Technology Group (ATG)

  • Introduction
  • XACT File Formats and Platforms
  • Deployment from the XACT Authoring Tool
  • Wave Bank Differences
  • Other Content and Authoring Differences
  • XACT Initialization and Auditioning Differences
  • Resource Management Differences
  • Real-Time Digital Signal Processing and XACT
  • Querying a Cue's Properties
  • Summary

Introduction

The Microsoft Cross-Platform Audio Creation Tool (XACT) allows sound designers and programmers to use the same content and code base for titles that run on both Xbox 360 and Microsoft Windows. This doesn't mean you can simply drop an identical binary wave bank into both platforms and expect it to work. The platforms do have differences. This white paper enumerates some of these differences, as well as the process of integrating and deploying across different target platforms. By understanding some of the differences and, more importantly, the similarities, you can create content more efficiently and deploy it quickly on multiple platforms.

The XACT documentation provided in the Xbox 360 Development Kit (XDK) and the Microsoft DirectX Software Development Kit (SDK) provides more detailed information on many of the concepts, interfaces, and methods described in this paper, as well as comments where APIs differ between the platforms.

XACT File Formats and Platforms

At the lowest platform level, a key format difference between Windows and Xbox 360 CPUs is byte ordering. Xbox 360 is a big-endian system and Windows is a little-endian system. The difference in endian-ness means that binary data files must be either converted or translated between the two platforms. XACT does this automatically when building and deploying content to a specific platform. However, even if all other elements of a given wave bank, sound bank, or global settings file are identical, the difference in byte ordering means you cannot use the same binary file on both platforms.

Deployment from the XACT Authoring Tool

XACT clearly points out the current target deployment platform, and similarly enables the content creator to switch easily between target platforms. The current target is specified in the View menu, and is shown in the XACT title bar.

Figure 1.  Two indicators that XACT is currently building for Windows (red circle added for emphasis).

Ee419204.wp_XACT_indicator(en-us,VS.85).jpg

 

XACT similarly makes it readily apparent in the built content's directory structure whether it was built for Windows or Xbox; by default, all Windows-based content is deployed to a "Win" directory, and all Xbox 360–based content is deployed to an "Xbox" directory. You can see these settings and change them if desired for specific wave banks or sound banks, all via the property page.

Figure 2.  A wave bank's Windows and Xbox 360 deployment properties. The file name is identical (though it doesn't have to be), and the two versions are deployed to Win and Xbox folders (relative directories are relative to the current project file's path).

Ee419204.wp_wave_bank_deploy(en-us,VS.85).jpg

Wave Bank Differences

Perhaps the most obvious difference between XACT for Xbox 360 and XACT for Windows is the compression targets. Xbox 360 has custom hardware for its platform-specific XMA format, so naturally most (if not all) wave content will be XMA-compressed on Xbox 360. Since Windows has no hardware-assisted compression system, and XMA would be extremely expensive to perform on multiple voices, XACT opts for the cheap-to-process ADPCM (Adaptive Differential Pulse Code Modulation) format on Windows.

By default, XACT wave content remains PCM on both platforms (though again, the deployment platform dictates endian-ness). Setting up compression involves the use of an XACT compression preset.

Figure 3.  Right-click on the Compression Presets project tree node and choose New Compression Preset to create a compression preset.

Ee419204.wp_compression_presets(en-us,VS.85).jpg

 

From here, XACT enables the content creator to set separate target formats for Xbox 360 and Windows. Here, the first differences become apparent.

Feature XMA (Xbox 360) ADPCM (Windows)
Level of compression User can specify a quality setting (on a scale of 1–100) to control compression versus artifacts. "Samples per block" allows for some level of compression control (frequency of header data). Compression remains roughly between 3.5:1 and 3.9:1.
Loop points The codec automatically "fixes" loop points to land at required 128-sample boundaries (through sample interpolation/decimation). The user must manually author wave loop points (or full-length if looping from start to finish) to conform to the samples-per-block setting.
Multichannel Multichannel PCM waves (WAVEFORMATEX) can be XMA compressed. (Note: currently only start-to-finish looping is supported for multichannel, pending XMA2 format adoption.) Currently supports mono and stereo only.

Other than compression, there are no other authoring differences between wave banks for Xbox 360 and wave banks for Windows. Both platforms support AIFF and PCM sources, at any arbitrary sampling rate(s) desired. Streaming wave banks have no differences across the two platforms—no special format change or settings are needed to stream from a hard drive versus an optical disc on Windows.

Other Content and Authoring Differences

Few other differences in authoring are apparent to the content creator. Of course, auditioning Xbox 360 XMA content requires the XMA hardware present in an Xbox 360 Development or Test Kit; conversely, hearing ADPCM compression requires auditioning locally on the Windows XACT engine. You can audition PCM-targeted audio data on both platforms identically.

Another possible divergence between the platforms, which is discussed in more detail from the programmer's point of view below, is the use of reverberation. An Xbox 360 title may choose to use an XAudio-created reverberation, as well as other digital signal processing (DSP) effects. Windows-based titles are currently restricted to the content-creator–initiated reverberation, and no other DSP effects. Do note that the provided reverberation effect itself (the Princeton Digital 2016/360 reverb, based on the same algorithms as the 2016 reverb from Eventide, with some enhancements) is identical across both platforms acoustically, though CPU performance may vary.

XACT Initialization and Auditioning Differences

Auditioning with the provided Audio Console Applications (for Xbox 360 and Windows) is effectively the same on both platforms, though the Xbox 360 presents visualizations and statistics not present on the Windows version. Connecting to a title compiled using the XACT library for real-time auditioning differs somewhat on the two platforms. On Xbox 360, using statically linked libraries means that you must specifically link your title using xacta.lib or xactad.lib (the "a" implies auditioning support) to be able to connect and audition/monitor content. On Windows, the engine instantiation call, XACTCreateEngine, allows the programmer to pass in a flag (XACT_FLAG_API_AUDITION_MODE) specifying whether to enable auditioning on this engine instance.

XACT for Xbox 360 initially had a "flat" XACT initialization call, XACTInitialize. Because Windows (and Xbox 360) allows for multiple instances, this function is not supported on Windows and should no longer be used for new Xbox 360 titles. Instead, use the XACTCreateEngine call, which allows the user to set up one or more XACT engine instances, and then use IXACTEngine::Initialize to configure a specific engine instance. Both platforms support these calls.

Because a Windows-based device can have multiple audio renderers, Windows provides several extended methods that are unnecessary on a single audio renderer such as the Xbox 360. IXACTEngine::Initialize takes a pRendererID parameter, allowing a title to determine which device to play this particular XACT engine instance through. The parameter is ignored on Xbox 360.

These additional interfaces, available only on Windows, enable a title to view available renderers and their properties.

Method Description
IXACTEngine::GetRendererCount Returns the number of audio renderers found on the system.
IXACTEngine::GetRendererDetails Returns details about the audio rendering device identified by the passed index.

Resource Management Differences

XACT for Windows and XACT for Xbox 360 both support platform-optimized memory system allocations, in addition to any allocation scheme that an individual title wishes to utilize. In scenarios where XACT automatically releases memory for the title (only when the title specifies, such as when XACT_FLAG_ENGINE_CREATE_MANAGEDATA is passed into engine initialization or wave bank creation), these platform-specific memory systems' allocators must be used.

Ee419204.note(en-us,VS.85).gifXbox 360

On Xbox 360, memory is allocated through XMemAlloc.

Ee419204.note(en-us,VS.85).gifWindows

On Windows platforms, memory is allocated through CoTaskMemAlloc.

Real-Time Digital Signal Processing and XACT

Ee419204.note(en-us,VS.85).gifXbox 360

XACT has rudimentary support for content-driven, real-time DSP. Currently, XACT supports only a single global reverberation, and it can be driven solely by the sound designer (that is, the content must apply any change to reverberation, which is awkward to implement). Because Xbox 360 has a fully-featured DSP pipeline (providing global, per-sound, and arbitrary submixed DSP processing) present in the lower-level XAudio library, Xbox 360 provides extensions to XACT that are not available on Windows. DSP on Windows is currently limited to native XACT DSP support, which again is a single reverberation.

The following methods, available only on Xbox 360, allow for XACT to utilize DSP effects.

Method Description
IXACTCue::SetVoiceOutputRoutes the output of a cue to up to three XAudio voices.
IXACTCue::SetVoiceOutputVolumeAdjusts the volume of a voice previously set by IXACTCue::SetVoiceOutput.

Similarly, the arbitrary DSP and signal routing support of the XAudio library allows XACT for Xbox 360 to take fuller advantage of the X3DAudio library for 3D positioning simulation. Real-time, distance-based filtering as well as occlusion and obstruction are available in this manner.

For more details on XACT-specific DSP functionality and these Xbox extensions, see the XACT 3D and Reverberation Integration white paper.

Querying a Cue's Properties

In response to Xbox 360 launch title needs, XACT cue instance objects have more transparency. Cue instance queries offer a convenient way to avoid having to establish offline (or worse, in-game) XACT project file analysis/parsing, or communicating large-scale information between the sound designer and programmer. This also enables the game to determine information that is unknown at authoring time, such as which variation settings have been selected. Because the information is incomplete (for example, limited to the first track in multitrack sounds, and not all object data presented), Windows does not currently expose this query, pending a more complete and elegant solution displaying more cue instance state information.

The following method, available only on Xbox 360, allows for XACT to return cue instance information to the title.

Method Description
IXACTCue::GetProperties Retrieves the properties of the cue.

Summary

Despite some of the unique methods and content differences discussed herein, the majority of XACT authoring and usage is identical across the platforms. Beyond establishing separate compression targets, most content creators and programmers will see little difference between Xbox 360 and Windows. And because XACT is a software layer on both platforms, newly exposed features will continue to maintain this level of functional and API parity.