以 3D 方式播放 fmod 事件声音
我有一个名为 Numbers 的活动。在 Fmod Designer 中,事件根据监听器角度播放不同的数字。当我将此事件放置在 3D 空间中时,我希望能够听到不同的声音。这是我目前拥有的代码。它只播放我的应用程序中的数字之一。我错过了什么吗?
FMOD_RESULT result = FMOD_OK;
FMOD_VECTOR listenerpos;
FMOD_VECTOR forward = { 0.0f, 0.0f, 1.0f };
FMOD_VECTOR up = { 0.0f, 1.0f, 0.0f };
FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f };
result = group->getEvent("Numbers", FMOD_EVENT_DEFAULT, &event);
ERRCHECK(result);
listenerpos.x = 0.436243;
listenerpos.y = -0.43643;
listenerpos.z = -6;
result = eventSystem->set3DListenerAttributes(0, &listenerpos, &vel, &forward, &up);
ERRCHECK(result);
非常感谢帮助!谢谢!
I have an event called Numbers. In Fmod Designer the event plays different numbers depending on listenerAngle. I want to be able to hear the different sounds when I position this event in a 3D space. This is the code I have at the moment. It only plays one of the numbers in my app. Am I missing something?
FMOD_RESULT result = FMOD_OK;
FMOD_VECTOR listenerpos;
FMOD_VECTOR forward = { 0.0f, 0.0f, 1.0f };
FMOD_VECTOR up = { 0.0f, 1.0f, 0.0f };
FMOD_VECTOR vel = { 0.0f, 0.0f, 0.0f };
result = group->getEvent("Numbers", FMOD_EVENT_DEFAULT, &event);
ERRCHECK(result);
listenerpos.x = 0.436243;
listenerpos.y = -0.43643;
listenerpos.z = -6;
result = eventSystem->set3DListenerAttributes(0, &listenerpos, &vel, &forward, &up);
ERRCHECK(result);
Help is very much appreciated! Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您的“数字”事件是 2D 的?你能检查并确保它是 3D 的吗?
Perhaps your "Numbers" event is 2D? Can you check and ensure it's 3D.
我添加了一些行并使其正常工作。我必须将事件放置在 3D 世界中。
I added some lines and got it working. I had to place out the event in the 3D world.