OpenAL 和 Popping 工件

发布于 2024-10-24 05:28:23 字数 549 浏览 5 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄兵必败 2024-10-31 05:28:23

它们变得明显......在第一个或第二个样本已经播放后

是否您正在将未初始化的数据添加到缓冲区?可能是由于对未完全填满的数组进行排队的结果。

They become apparent ... after the 1st or 2nd sample has already been played

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文