Calculates DSP settings with respect to 3D parameters.
void X3DAudioCalculate(
const X3DAUDIO_HANDLE Instance,
const X3DAUDIO_LISTENER *pListener,
const X3DAUDIO_EMITTER *pEmitter,
UINT32 Flags,
X3DAUDIO_DSP_SETTINGS *pDSPSettings
)
Instance
Type: X3DAUDIO_HANDLE
[in] 3D audio instance handle. Call X3DAudioInitialize to get this handle.
pListener
Type: X3DAUDIO_LISTENER *
[in] Pointer to an X3DAUDIO_LISTENER representing the point of reception.
pEmitter
Type: X3DAUDIO_EMITTER *
[in] Pointer to an X3DAUDIO_EMITTER representing the sound source.
Flags
Type: UINT32
| 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. |
pDSPSettings
Type: X3DAUDIO_DSP_SETTINGS *
[in, out] Pointer to an X3DAUDIO_DSP_SETTINGS structure that receives the calculation results.
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.
Note that it is extremely important that the listener and emitter values 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.
Header: Declared in x3daudio.h.
Library: Use xaudio2.lib.