X3DAudioCalculate function (x3daudio.h)

Calculates DSP settings with respect to 3D parameters.


X3DAUDIO_API_(void) X3DAudioCalculate(
  [in]      const X3DAUDIO_HANDLE   Instance,
  [in]      const X3DAUDIO_LISTENER *pListener,
  [in]      const X3DAUDIO_EMITTER  *pEmitter,
  [in]      UINT32                  Flags,
  [in, out] X3DAUDIO_DSP_SETTINGS   *pDSPSettings


[in] Instance

3D audio instance handle. Call X3DAudioInitialize to get this handle.

[in] pListener

Pointer to an X3DAUDIO_LISTENER representing the point of reception.

[in] pEmitter

Pointer to an X3DAUDIO_EMITTER representing the sound source.

[in] Flags

Value Description
X3DAUDIO_CALCULATE_MATRIX Enables matrix coefficient table calculation. 
X3DAUDIO_CALCULATE_DELAY Enables delay time array calculation (stereo only). 
X3DAUDIO_CALCULATE_LPF_DIRECT Enables low pass filter (LPF) direct-path coefficient calculation. 
X3DAUDIO_CALCULATE_LPF_REVERB Enables LPF reverb-path coefficient calculation. 
X3DAUDIO_CALCULATE_REVERB Enables reverb send level calculation. 
X3DAUDIO_CALCULATE_DOPPLER Enables Doppler shift factor calculation. 
X3DAUDIO_CALCULATE_EMITTER_ANGLE Enables emitter-to-listener interior angle calculation. 
X3DAUDIO_CALCULATE_ZEROCENTER Fills the center channel with silence. This flag allows you to keep a 6-channel matrix so you do not have to remap the channels, but the center channel will be silent. This flag is only valid if you also set X3DAUDIO_CALCULATE_MATRIX. 
X3DAUDIO_CALCULATE_REDIRECT_TO_LFE Applies an equal mix of all source channels to a low frequency effect (LFE) destination channel. It only applies to matrix calculations with a source that does not have an LFE channel and a destination that does have an LFE channel. This flag is only valid if you also set X3DAUDIO_CALCULATE_MATRIX. 

[in, out] pDSPSettings

Pointer to an X3DAUDIO_DSP_SETTINGS structure that receives the calculation results.

Return value

This function does not return a value.


You typically call X3DAudioCalculate once for each pair of emitting objects and listeners in the scene. After each call, to apply the 3D effects, the app manually applies the calculation results at pDSPSettings to the XAUDIO2 graph. For more info, see How to: Integrate X3DAudio with XAudio2.

Important   The listener and emitter values must be valid. Floating-point specials (NaN, QNaN, +INF, -INF) can cause the entire audio output to go silent if introduced into a running audio graph.

Platform Requirements

Windows 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

Windows Phone 8.1: This API is supported.


Target Platform Windows
Header x3daudio.h
Library Xaudio2.lib

See also