OpenAL 和 Popping 工件
我正在使用 OpenAL 作为 iPad 音乐应用程序。以前运行良好,但现在,在将我的设备更新到 iOS 4.3 后,播放时会出现爆裂/爆裂的噪音。当播放多个样本(即和弦)时,它们会变得明显,并且在第一个或第二个样本已经播放之后,发生在新样本的开头。除了这些音损之外,其余的音频输出都是正常的。
我缓冲每个乐器的音频数据,为每个要播放的声音创建一个源,并将该源附加到缓存的缓冲区。使用 alBufferDataStaticProc() 将缓冲区附加到音频数据样本
我还更改了 AL 上下文的 AL_FREQUENCY 以匹配文件的采样频率 (16 khz),但这仅解决了样本(源)为beplayed 的 AL_PITCH 值为 1。所以可以肯定的是,如果更改 AL_PITCH,则更改了源的输出频率,这将与 AL 上下文的输出频率不匹配,从而导致该问题
部分代码借用Finch,它做了很多数据初始化。这是源代码的 URL: https://github.com/zoul/Finch
我期待到任何指针。
I am using OpenAL for a music app for iPad. It has worked fine before, but now, after updating my device to iOS 4.3, there are popping/crackling noises on playback. They become apparent when multiple samples are played (i.e. chords), and happen at the beginning of a new sample, after the 1st or 2nd sample has already been played. Besides these artifacts, the rest of the audio output is normal.
I buffer audio data for each instrument, create a source for each sound to be played, and attach the source to a cached buffer. The buffer is attached to a sample of audio data by using alBufferDataStaticProc()
I have also changed AL_FREQUENCY of the AL context to match the sampling frequency of the files (16 khz), but that only fixes the issue when the sample (source) to be played has an AL_PITCH value of 1. So what's certain is that if you change AL_PITCH, you change the output frequency of the source, which will not match the output frequency of the AL context, causing the problem
Some of the code is borrowed from Finch, which does a lot of data initialization. Here is a URL to the source code: https://github.com/zoul/Finch
I look forward to any pointers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否您正在将未初始化的数据添加到缓冲区?可能是由于对未完全填满的数组进行排队的结果。
Could it be that you're adding unintialised data to the buffer? Possibly as a result of queuing an array that was not fully filled.