Hi Thomas,
Here is the advantages of XAudio2 from an article:
An Introduction and Overview of XAudio2
by Brian Schmidt
Gamasutra
January 29, 2008
XAudio2 Features and Architecture
XAudio2 provides many features necessary for the creation of modern game
sound design:
Cross platform between Xbox 360 and Windows-based platforms, including
Microsoft Windows XP and Windows Vista
Arbitrary levels of submixing
A simple streaming model
A software-based, dynamic DSP effects model, both local and global
Simple C language code for arbitrary DSP processing using xAPOs (audio
processing objects)
Native compressed data support: XMA and xWMA on Xbox 360, ADPCM and xWMA on
Windows
A complement of DSP audio effects
Fully transparent surround sound/3D audio processing
Clean separation of voices from data
Non-blocking processing suitable for multi-core, multi-threaded systems
Efficient and optimized for Windows and Xbox 360
Optimized in-line filter on each voice
--------------------------------------------------------------------------------
There are three main components in XAudio: source voices, submix voices, and
a mastering voice.
A source voice is most analogous to a DirectSound buffer. You create a
source voice when you want to play a sound. You can set parameters on a
voice, such as pitch and volume, and specify the volume levels for each
speaker for surround effects. You can also dynamically place arbitrary
software-based DSP effects on a source voice.
Once you create a source voice, you point it to a piece of sound data in
memory and play it. (This data can be in a variety of formats: PCM, XMA, or
xWMA for Xbox; PCM, ADPCM, or xWMA for Windows.). A source voice can also
point to no source data, if it contains software for direct generation of
audio data. By default, the output is sent to the speakers via the mastering
voice, but a source voice can also send its output to one or more submix
voices as well.
A submix voice is much like a source voice, with two differences. First, the
sound data for a submix voice is not a piece of sound data in memory, but
rather the output of another source (or submix) voice. Secondly, a submix
voice can have multiple inputs-each of the inputs will be mixed by the
submix voice before processing.
As with source voices, you can insert arbitrary software DSP effects into a
submix voice-in this case, the DSP will process the aggregate mix of all the
inputs. Submix voices also have built-in filters, and can be panned to the
speakers just like a source voice can. Submix voices are very useful for
creating complex sound effects from multiple wave files. They can also be
used to create audio submixes-for example a sound effects mix, a dialog mix,
a music mix, and so on-in the way that professional mixing consoles have
buses. Submix buses are also used for global effects, such as a global
reverb.
The final component is the mastering voice. There is only one mastering
voice, and its job is to create the final N-channel (stereo, 5.1, 7.1)
output to present to the speakers. The mastering voice takes input from all
the source voices and submix voices, combines them and prepares them for
output. As with source voices and submix voices, software DSP effects can be
placed on the mastering voice. Most typically a 5.1 mastering limiter or
global EQ is inserted into the mastering voice for that final, polished
sound.
The following figure shows a simple XAudio2 graph playing two sounds with an
environmental reverb. The top two source voices are playing sound data to
create a single composite sound that is routed to the submix voice.
From the submix voice, a 5.1 send goes to the mastering voice and a mono
send goes to another submix voice that hosts a global reverb effect. 3D
panning for the composite sound is performed on the first submix voice. The
bottom source voice is used to play a single sound. Its 5.1 output goes to
the mastering voice and also has a mono send to the global reverb. Of
course, many more options are possible, but this shows a common case.
DSP Effects and xAPOs
DSP effects in XAudio2 are performed using software audio processing objects
(xAPOs). An xAPO is a lightweight wrapper for audio signal processing
combined with a standard method for getting and setting appropriate DSP
effects parameters.
Since xAPOs are cross-platform, it is easy to write software-based audio DSP
effects that can be run on both Windows and Xbox 360. Typical software
effects might include reverb, filtering, echo or other effects, but can also
include physical modeling synthesis, granular synthesis, or any kind of
wacky audio DSP you might come up with! You can write processor-specific
optimizations for Xbox and Windows, but that's not required.
--------------------------------------------------------------------------------
3D and Surround Sound
3D and surround sound in XAudio2 is perhaps the biggest departure from
DirectSound's model. In DirectSound, DirectSound3D buffers and the
DirectSound3DListener were used to take a sound emitter's x, y, z position
in 3D space and cause the sound to seem to come from the appropriate
location. In XAudio2, there is no inherent notion of 3D-there is nothing
analogous to a DirectSound3D buffer.
Instead, an application specifies individual volume levels for each speaker,
typically 5.1 or 7.1. A game can put a sound only in a specific speaker (for
example, the center channel for dialogue), or it can calculate the
appropriate volume level for each speaker given the x, y, z positions of
sound source and camera.
To make this easy, a complementary API, X3DAudio, is used. X3DAudio converts
simple game geometry data into signal processing parameters suitable for
passing to XAudio2. It takes x, y, z coordinates for sound sources and
listeners, and outputs a vector of speaker volumes for each output speaker.
X3DAudio has only two functions, X3DAudioInitialize and X3DAudioCalculate.
X3DAudio allows for multiple sound sources, multiple listeners, cones, and a
flexible mapping model. X3DAudio also returns the results of some of its own
internal calculations, such as source-to-listener distance, internal data
from Doppler calculations and other information valuable to the game engine
itself.
By separating the signal processing library, XAudio2, from the geometry
library, X3DAudio, 3D audio becomes much more flexible and transparent. The
following figure shows how X3DAudio and XAudio2 are used together by the
game engine to create 3D/Surround sound.
The Audio Stack: Top to Bottom
On Xbox 360, XAudio2 sits on top of the XMA hardware decoder and the audio
output system of Xbox 360. On Windows Vista, XAudio2 streams directly into
the lowest audio API, WASAPI, while on Windows XP, it streams its output to
a single DirectSound buffer.
---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].