iOS/OSX 上的 OpenAL 音频质量较差
我发现自己正在将一款旧的多媒体游戏移植到 iOS/OSX,但我对通过 OpenAL 实现的音频输出质量有些失望,因为当 PCM 重新采样不佳时,人们会听到“刺耳”的质量。然而,我以 11025KHz 为其提供 8 位 PCM,并且我确实相信本机速率为 44100KHz,所以我无法想象为什么会发生除了样本的 1:4 积分扩展之外的任何情况。在 Win32 系统上播放时声音本身非常干净,所以我知道数据本身没有问题。也不存在任何缓冲问题,因为我在播放位置之前保留了大约 32K 的缓冲。但音质并不是那么好。有其他人遇到过这个问题吗?是否有配置选项可以解决这个问题?我已经浏览了文档,似乎没有任何内容适用于该问题......
I find myself porting an old multimedia title to iOS/OSX and I'm somewhat disappointed with the quality of audio output I've achieved via OpenAL, in that it's got that "scratchy" quality one hears when PCM is resampled poorly. However, I'm feeding it 8-bit PCM at 11025KHz and I do believe the native rate is 44100KHz so I can't imagine why anything other than a 1:4 integral expansion of the samples would be occurring. The sound itself is very clean when played back on a Win32 system so I know there's no problems with the data itself. Nor are there any buffering problems in that I'm keeping about 32K buffered ahead of the playback position. But the sound quality just isn't that good. Has anyone else encountered this and are there configuration options to work around it? I've gone through the docs and nothing seems applicable to the problem ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iOS 不能很好地处理 8 位数据。尝试将其转换为 16 位。
您还可以将其压缩为 mp3 或 aac,但这加载起来稍微复杂一些,因为加载时需要将其转换为 16 位小端格式。
这是一个处理任何 16 位音频格式的加载器: https://github.com/kstenerud/ObjectAL-for-iPhone/blob/master/ObjectAL/ObjectAL/Support/OALAudioFile.m
iOS doesn't handle 8-bit data very well. Try converting it to 16-bit.
You could also compress it to mp3 or aac, but that's a little more complicated to load since it needs to be converted to 16-bit little endian format when loaded.
Here's a loader that handles any 16-bit audio format: https://github.com/kstenerud/ObjectAL-for-iPhone/blob/master/ObjectAL/ObjectAL/Support/OALAudioFile.m