microsoft / DirectXTK

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
https://walbourn.github.io/directxtk/
MIT License
2.55k stars 506 forks source link

Multi-channel reverb #170

Closed ifree closed 5 years ago

ifree commented 5 years ago

I don't know where is the right place to ask this question, so I put it here, sorry.

According to XAudio2's document, the reverb support mono/stereo in 5.1 out.

The input and output channels must be one of the following combinations. Mono input and mono output Mono input and 5.1 output Stereo input and stereo output Stereo input and 5.1 output

If I create the reverb with mono input and 5.1 output, will there any difference among the 6 output channels, or they'll just be the same reverb effect?

Thanks

walbourn commented 5 years ago

As you note, this is really a question about XAudio2's implementation rather than a question about DirectX Tool Kit for Audio.

Looking at the source for XAudio 2.7 (the last version to support Windows 7), the reverb supports:

It uses the Princeton Digital Reverb 2004 algorithm.

There are a number of parameters for left vs. right channels. In the mono case, the right channel information is unused as noted in the code comments in xaudio2fx.h.

For mono-processing, the standard approach is to replicate it to the 5 left/right/center channels (no LFE). For stereo-processing, all left channel information goes to the left surround speakers, right to right, and center is a mix.

In the standard X3DAudio set, you drive LFE from X3DAUDIO_CALCULATE_REDIRECT_TO_LFE. See XAudio2Sound3D

ifree commented 5 years ago

Thank you very much!