XAudio 2 FAQ (v1.1 / updated Tuesday, July 31, 2007)
What is it?
XAudio 2 is a new low-level, cross-platform audio API under development for Xbox 360 and Windows. XAudio 2, like its predecessors XAudio and DirectSound, provides the signal processing and mixing foundation used by games for their audio processing. On Windows, it is the first significant change in Microsoft’s low-level game audio API’s in more than 7 years!
Therefore, for Windows game developers it is the long-awaited replacement for DirectSound.
For Xbox developers, it is an enhanced version of the current XAudio API, which addresses some outstanding issues and customer feature requests. Because it is cross-platform, XAudio 2 enables Windows and Xbox developers a “write once, compile twice” solution for the low-level game audio needs significantly reducing the amount of work required to port across platforms.
What are the differences from DirectSound?
· Cross-platform with Xbox 360
· Enhanced multi-channel/surround sound support. (No longer restricted to 3D-positioned sounds; all sounds can be dynamically routed to any speaker or speakers.)
· 3D positioning is handled via a separate, and replaceable, math library (X3DAudio – see below)
· Programmable DSP effects framework (common to all XAudio 2 platforms)
· Per-voice filtering (built-in, in addition to programmable DSP effects)
· Submixing (arbitrary levels and routings)
· Compressed audio support (ADPCM, WMA, XMA)
· Multi-rate processing for decreased CPU usage (voice chains can run at different sampling rates)
What are the differences from XAudio (the existing Xbox 360 low-level audio library)?
· Cross-platform with Windows (XP/Vista)
· Multi-rate processing for decreased CPU usage (voice chains can run at less than 48 kHz)
· Non-blocking API model
· A resonant filter available on every XAudio 2 voice (“built-in”, so no effect chain assembly needed to access it)
· Removal of the 6-channel limit on voices (allowing for true synchronized, dynamic multi-track mixing)
· A dynamic DSP framework (effects can be swapped in and out at will; the framework is shared by Xbox and Windows, so the same effects can be used on both platforms)
How is 3D sound positioning handled in XAudio 2?
One significant difference from DirectSound (and a similarity to XAudio) is that 3D audio positioning is abstracted to a separate pluggable math library. X3DAudio (already used by XACT on all platforms, as well as by XAudio on Xbox 360) offers numerous enhancements over traditional DirectSound3D. An incomplete list of features:
· Multiple listener and emitter support. Emitters are also independent from listeners.
· Enhanced distance model – in addition to mapping to attenuation, distance can drive LFE send level, reverb send level, distance-based filtering, and other components.
· More intuitive rolloff. “Min distance”, “Max distance”, and “rolloff factor” are gone; instead, specify custom curves with arbitrary numbers of (distance, value) pairs to know exactly how an emitter will behave at a given distance.
· Support for multi-channel source content, which can be positioned as a point source or as…
· Multi-point emitters, which allow for positional and rotational multi-channel environments and objects
· Calculation transparency: intermediate calculations are returned to the title. Additionally, the title can specify which calculations they want performed.
Because X3DAudio is an abstracted math-driven library, it can also be replaced selectively or in its entirety by a title’s own custom 3D behaviors.
What is the XAudio 2 ship schedule?
We are anticipating XAudio 2 being available as an approved non-beta library for titles to ship with early next year, in the March 2008 XDK/SDK release. There will be at least two beta releases, coinciding with the August and November 2007 XDK/SDK releases. The betas will ship with full documentation and multiple samples.
What does this mean for XAudio, DirectSound, and dependent components?
XAudio support will be gradually phased out over a specific period of time. All Xbox libraries that used XAudio (in particular XACT, but also XHV, XUI, and others) are shifting to use the XAudio 2 library. DirectSound on Windows will still be supported, but will be in ‘maintenance mode’, not undergoing active development. It is strongly recommended that Windows titles similarly move to XAudio 2 for the reasons outlined above, as well as for cross-platform support.
XACT is already cross-platform – why do I need XAudio 2?
XACT is a high-level game audio API with a rich content tool designed for game developers who want a turnkey solution for content-driven game audio. XACT does not do any signal processing or mixing and does not work at the “sample” level. In contrast, XAudio 2 is a low-level signal processing and mixing engine akin to DirectSound or XAudio. It is designed for developers who want to write their own game audio engines, use a mixture of content-driven audio and programmatic-driven audio, or who prefer not to use a content driven solution such as XACT. XAudio 2 will also become the common low-level signal processing engine upon which XACT is built.
What can I expect in the beta?
The beta is intended to allow programmers to familiarize themselves with the new APIs of XAudio 2. Basic playback, routing, and mixing will be supported, though not all formats and features may be enabled in all betas. In particular, these and other elements will become more fully functional in future XAudio 2 releases:
· ADPCM and WMA playback (on both platforms), XMA playback (on Windows)
· Reverberation and arbitrary programmable DSP playback support
We are hoping to receive feedback as you become familiar with the new objects and interfaces of XAudio 2, letting us know your transition experiences, where documentation and samples could be enhanced, and any areas you would prefer were approached differently. Private feedback can be sent from this Microsoft Connect XAudio 2 Beta Site. General discussion (both with XAudio 2 programmers and with other XAudio 2 users) is being handled in the audio section of the XNA Forums, which can be found here:
http://forums.xna.co.../ShowForum.aspx
Is XAudio 2 available for XNA? [added 7.31.07]
Just to clarify, I presume you’re referring to XNA Game Studio? The term ‘XNA’ in general applies to all Microsoft game technologies, including the DirectX SDK, Xbox 360 XDK, etc. Regardless, specific to XNA Game Studio, we are currently evaluating XAudio 2 for future deployment on the platform. Note that as XNA Game Studio is a managed code space, the API would likely be somewhat simplified, just as XACT and graphics APIs have been. Certainly no changes would be made while XAudio2 is in beta. XACT remains the best avenue for implementing game audio on XNA Game Studio at present.
Will XAudio 2 on Windows work, and behave the same, with all Windows XP and Vista audio hardware? [added 7.31.07]
XAudio 2 is fully a software audio rendering layer – that means that it works pretty transparent to whatever audio hardware you’re using, whether on Windows XP or Windows Vista. Applications can see what formats the hardware supports, though it's often easier to have your engine just assume a fixed target output format and allow the system to up/downmix for you. XAudio 2 is intended as the replacement for DirectSound for Windows game titles. (Technically on Windows XP, it operates ‘on top of’ DirectSound, though it’s essentially just a pass-through; on Windows Vista, it operates directly on the low-level audio renderer, in parallel to any legacy DirectSound applications.) But you can indeed mix and match between DirectSound, XAudio 2, and middleware audio engines. As to differences between XP and Vista, the API itself is identical, as its ability to query for supported output formats. Performance characteristics may differ of course, since it's sitting on different low-level rendering layers on the two platforms.