OpenAL 同步
我是音频编程的新手,所以如果我没有使用正确的术语,请原谅...
我有两个流缓冲区,我希望同时完全同步播放。我想控制流之间的混合比例。我确信这就像让两个源播放并改变它们的增益一样简单,但我读到人们做了一些技巧,例如使用 2 个通道缓冲区而不是两个单通道。然后他们从单一来源播放,但控制通道之间的混合。我读的文章不是关于 OpenAL 的,所以我的问题是:这对于 OpenAL 是否可行?
我想我不必这样做,但现在我很好奇并想学习如何设置。我应该设置 alFilter 吗? Creative 的文档称,“包含多个数据通道的缓冲区将在没有 3D 空间化的情况下播放。”读到这里,我想我需要对缓冲级别进行预通过,然后让源输出混合单声道信号。
我想我会问另一个问题。 OpenAL 是否足够灵活,可以完成这样的技巧?
我手动解码我的流,因此我意识到在输入缓冲区之前自己进行混合是多么容易,但随后我将无法实时更改混合因子,因为我已经缓冲了一秒左右的流。
I'm new to audio programming so excuse me if I'm not using the right terms...
I have two streaming buffers that I want to have playing simultaneously completely synchronized. I want to control ratio of blending between the streams. I'm sure it's as simple as having two sources playing and just changing the their gain, but I read about people doing some tricks like having 2 channels buffer instead of two single channels. Then they play from a single source but control the blending between the channels. The article I read wasn't about OpenAL so my question is: Is this even possible with OpenAL?
I guess I don't have to do it this way but now I'm curious and want to learn how to set it up. Do I suppose to setup alFilter? Creative's documentation sais "Buffers containing more than one channel of data will be played without 3D spatialization." Reading this I guess I need a pre-pass on a buffer level and then having the source output blended mono channel signal.
I guess I'll ask another question. Is OpenAL flexible enough to do tricks like this?
I decode my stream manually so I realize how easy it will be to do the blending myself before feeding the buffer but then I won't be able in real time to change the blending factor since I already have a second or so of the stream buffered.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
,应该如此。你尝试过吗?问题出在哪里?
Yes, it should be. Did you try that? What was the problem?