是否有在 C++ 中将 EAX 与 DirectSound 或 XAudio2 一起使用的示例/教程/资源?我找不到任何东西,我的游戏引擎真的需要它。
最佳答案
首先,DirectSound 在这一点上是古老的。旧游戏仍然支持它,并且 DirectSound 8 header 位于 Windows SDK 中,但十多年来没有针对它的示例或文档更新。
但是,Windows 音频驱动程序模型 (WDM) 不支持 Creative EAX 所需的硬件音频混合。自 Windows Vista 起已删除对此的支持,因此无法通过 DirectSound 或 XAudio2 使用 EAX。
总结一下 Windows Vista 驱动程序模型对 DirectSound 的更改:
LOC_SOFTWARE
缓冲区可以支持环绕声多声道格式。在 Windows XP 上,LOC_SOFTWARE
仅支持单声道或立体声。 .LOC_HARDWARE
不支持缓冲区。XAudio2 支持环境混响和 3D 音频定位,包括多声道源,所有这些都在软件中完成。
XAudio 2.8 is in the Windows SDK, although you need to use the legacy DirectX SDK for XAudio 2.7 to target Windows 7 or Windows Vista--see this post for details. Samples can be found on GitHub. The DirectX Tool Kit for Audio is very useful abstraction for using XAudio2 from C++.
更新: XAudio 2.9 现在可通过 XAudio2Redist 在 Windows 7 SP1 或更高版本上使用并避免使用旧版 DirectX SDK 或旧版 DirectSetup 部署。
要获得 EAX 等功能的硬件访问权限,您必须使用 OpenAL 等第 3 方解决方案。见Creative site更多。
关于C++ - 将 DirectSound 或 XAudio2 与 EAX 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35136651/