XAudio2 Reference

Describes the interfaces, functions, structures and enumeration that make up the Xudio2 API.

Interfaces

Name Description
IXAudio2 IXAudio2 is the interface for the XAudio2 object that manages all audio engine states, the audio processing thread, the voice graph, and so forth. This is the only XAudio2 interface that is derived from the COM IUnknown interface. It controls the lifetime of the XAudio2 object using two methods derived from IUnknownIXAudio2::AddRef and IXAudio2::Release. No other XAudio2 objects are reference-counted. Their lifetimes are explicitly controlled using create and destroy calls, and are bounded by the lifetime of the XAudio2 object that owns them.
IXAudio2EngineCallback The IXAudio2EngineCallback interface contains methods that notify the client when certain events happen in the IXAudio2 engine.This interface should be implemented by the XAudio2 client. XAudio2 calls these methods via an interface pointer provided by the client, using the XAudio2Create method. Methods in this interface return void, rather than an HRESULT. See XAudio2 Callbacks for restrictions on callback implementation.
IXAudio2MasteringVoice A mastering voice is used to represent the audio output device.Data buffers cannot be submitted directly to mastering voices, but data submitted to other types of voices must be directed to a mastering voice to be heard. IXAudio2MasteringVoice inherits directly from IXAudio2Voice, but does not implement methods specific to mastering voices. The interface type exists solely because some of the base class methods are implemented differently for mastering voices. Having a separate type for these voices helps client code to distinguish the different voice types and to benefit from C++ type safety.
IXAudio2SourceVoice Use a source voice to submit audio data to the XAudio2 processing pipeline.You must send voice data to a mastering voice to be heard, either directly or through intermediate submix voices.
IXAudio2SubmixVoice A submix voice is used primarily for performance improvements and effects processing.
IXAudio2Voice IXAudio2Voice represents the base interface from which IXAudio2SourceVoice, IXAudio2SubmixVoice and IXAudio2MasteringVoice are derived. The methods listed below are common to all voice subclasses.
IXAudio2VoiceCallback The IXAudio2VoiceCallback interface contains methods that notify the client when certain events happen in a given IXAudio2SourceVoice. This interface should be implemented by the XAudio2 client. XAudio2 calls these methods through an interface pointer provided by the client in the IXAudio2::CreateSourceVoice method. Methods in this interface return void, rather than an HRESULT. See the XAudio2 Callbacks topic for restrictions on callback implementation.

Functions

Name Description
ReverbConvertI3DL2ToNative Inline function that converts I3DL2 (Interactive 3D Audio Rendering Guidelines Level 2.0) parameters to native XAudio2 parameters.
X3DAudioCalculate Calculates DSP settings with respect to 3D parameters.
X3DAudioInitialize Sets all global 3D audio constants.
XAudio2AmplitudeRatioToDecibels Inline function that converts an amplitude ratio value to a decibel value.
XAudio2Create Creates a new XAudio2 object and returns a pointer to its IXAudio2 interface.
XAudio2CreateReverb Creates a new reverb audio processing object (APO), and returns a pointer to it.
XAudio2CreateVolumeMeter Creates a new volume meter audio processing object (APO) and returns a pointer to it.
XAudio2CutoffFrequencyToOnePoleCoefficient Inline function that converts from filter cutoff frequencies expressed in hertz to the filter coefficients used with the Frequency member of the XAUDIO2_FILTER_PARAMETERS structure.This function applies to LowPassOnePoleFilter and HighPassOnePole filter types only, use XAudio2CutoffFrequencyToRadians for state-variable filter types.
XAudio2CutoffFrequencyToRadians Inline function that converts from filter cutoff frequencies expressed in hertz to the radian frequency values used in the Frequency member of the XAUDIO2_FILTER_PARAMETERS structure.
XAudio2DecibelsToAmplitudeRatio Inline function that converts a decibel value to an amplitude ratio value.
XAudio2FrequencyRatioToSemitones Inline function that converts a frequency ratio value to a semitone value.
XAudio2RadiansToCutoffFrequency Inline function that converts from the radian frequencies used in XAUDIO2_FILTER_PARAMETERS back to absolute frequencies in hertz.
XAudio2SemitonesToFrequencyRatio Inline function that converts a semitone value to a frequency ratio value.

Structures

Name Description
WAVEFORMATEX The WAVEFORMATEX structure defines the format of waveform-audio data. Only format information common to all waveform-audio data formats is included in this structure. For formats that require additional information, this structure is included as the first member in another structure, along with the additional information.
WAVEFORMATEXTENSIBLE The WAVEFORMATEXTENSIBLE structure defines the format of waveform-audio data for formats having more than two channels or higher sample resolutions than allowed by WAVEFORMATEX.
X3DAUDIO_CONE Specifies directionality for a single-channel non-LFE emitter by scaling DSP behavior with respect to the emitter’s orientation.
X3DAUDIO_DISTANCE_CURVE Defines an explicit piecewise curve made up of linear segments, directly defining DSP behavior with respect to normalized distance.
X3DAUDIO_DISTANCE_CURVE_POINT Defines a DSP setting at a given normalized distance.
X3DAUDIO_DSP_SETTINGS Receives the results from a call to X3DAudioCalculate.
X3DAUDIO_EMITTER Defines a single-point or multiple-point 3D audio source that is used with an arbitrary number of sound channels.
X3DAUDIO_LISTENER Defines a point of 3D audio reception.
XAUDIO2_BUFFER Represents an audio data buffer, used with IXAudio2SourceVoice::SubmitSourceBuffer.
XAUDIO2_BUFFER_WMA Used with IXAudio2SourceVoice::SubmitSourceBuffer when submitting xWMA data.
XAUDIO2_DEBUG_CONFIGURATION Contains the new global debug configuration for XAudio2. Used with the SetDebugConfiguration function.
XAUDIO2_EFFECT_CHAIN Defines an effect chain.
XAUDIO2_EFFECT_DESCRIPTOR Contains information about an XAPO for use in an effect chain.
XAUDIO2_FILTER_PARAMETERS Defines filter parameters for a source voice.
XAUDIO2_PERFORMANCE_DATA Contains performance information.
XAUDIO2_SEND_DESCRIPTOR Defines a destination voice that is the target of a send from another voice and specifies whether a filter should be used.
XAUDIO2_VOICE_DETAILS Contains information about the creation flags, input channels, and sample rate of a voice.
XAUDIO2_VOICE_SENDS Defines a set of voices to receive data from a single output voice.
XAUDIO2_VOICE_STATE Returns the voice’s current state and cursor position data.
XAUDIO2FX_REVERB_I3DL2_PARAMETERS Describes I3DL2 (Interactive 3D Audio Rendering Guidelines Level 2.0) parameters for use in the ReverbConvertI3DL2ToNative function.
XAUDIO2FX_REVERB_PARAMETERS Describes parameters for use in the reverb APO. These parameters support 7.1 surround sound.
XAUDIO2FX_VOLUMEMETER_LEVELS Describes parameters for use with the volume meter APO.

Enumerations

Name Description
XAUDIO2_FILTER_TYPE Indicates the filter type.