OpenAL - 如何播放不衰减的音效?
我在 iPhone 项目中使用 OpenAL 来创建远离听者时衰减的声音。
不过——我也想播放一些不因距离而衰减的音效。
到目前为止,我通过使用不会衰减的立体声解决了这个问题。但现在我添加了很多配音,这需要相当多的空间 - 所以我希望它们是单声道的,现在又遇到了问题,它们会因距离而减弱。
我的下一个解决方案是将播放语音样本的源的“AL_MIN_GAIN”设置为 1.0,但这似乎仅适用于模拟器,不适用于设备。
是否有其他方法可以使用 openAL 播放不因距离而衰减的音效?
I'm using OpenAL in my iPhone project to create sounds that attenuate when farther away from the listener.
However - I also want to play some sound effects that shall not be attenuated by distance.
So far I solved that by using stereo sounds, which don't get attenuated. But now I'm adding a lot of voiceacting which takes quite some space - so I want them to be mono and now have the problem again that they get attenuated by distance.
My next solution was to set "AL_MIN_GAIN" of the source playing the voice samples to 1.0, but this seems to be working only on the simulator, not on the device.
Are there other ways to play sound effects with openAL that shall not be attenuated by distance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
然后音源应该停留在听者的位置。
And then the source should stay at the listener's position.
您可以尝试打开第二个没有距离模型的上下文。我不确定 iOS 是否支持多个上下文...
或者,只需将“声音”源保持在与听众相同的位置即可。
You can try opening a second context that doesn't have a distance model. I'm not sure if iOS supports multiple contexts or not though...
Alternatively, just keep your "voice" sources at the same position as the listener.
只需使用
中定义的AL_DIRECT_CHANNELS_SOFT
宏即可Just use
AL_DIRECT_CHANNELS_SOFT
macro is defined in<AL/alext.h>