iPhone 上的有损压缩格式为原始 PCM

发布于 2024-07-13 15:51:47 字数 527 浏览 6 评论 0原文

我想从文件大小适中的音频文件开始,并以可以使用 alBufferData 加载到 OpenAL 中的 unsigned char 数组结束。 我的麻烦是中间发生的步骤。

我认为 AAC 将是最佳选择,但根据 Apple 代表 Rincewind 的说法(大约12/08):

目前 iPhone 操作系统上不支持硬件辅助压缩格式的解​​码。 这些格式是 AAC、MP3 和 ALAC。

将 ExtAudioFile 与客户端格式集一起使用会生成 PERM 错误,因此他不是在编造事情。

那么,勇敢的知识拥有者,我有什么选择呢? 将应用程序打包为 .wav,然后就忍受大量下载? 自己写解码器?

任何您可能拥有的资源或建议的链接将不胜感激。

I want to start with an audio file of a modest filesize, and finish with an array of unsigned chars that can be loaded into OpenAL with alBufferData. My trouble is the steps that happen in the middle.

I thought AAC would be the way to go, but according to Apple representative Rincewind (circa 12/08):

Currently hardware assisted compression formats are not supported for decode on iPhone OS. These formats are AAC, MP3 and ALAC.

Using ExtAudioFile with a client format set generates PERM errors, so he's not making things up.

So, brave knowledge-havers, what are my options here? Package the app with .wav's and just suck up having a massive download? Write my own decoder?

Any links to resources or advice you might have would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

红焚 2024-07-20 15:51:48

现在可以离线渲染压缩音频,请参阅 QA1562

Offline rendering of compressed audio is now possible, see QA1562.

一抹微笑 2024-07-20 15:51:48

虽然 Vorbis 和其他人建议的都很好,但由于没有硬件加速,它们在 iPhone 上可能会相当慢。

ADPCM(又名 ima4)是本机支持的一种编解码器(但压缩比仅为 4:1)。 它通过 ExtAudioFile 接口进行处理,并且只比直接加载 .wav 慢一点点。

While Vorbis and the others suggested are good, they can be fairly slow on the iPhone as there is no hardware acceleration.

One codec that is natively supported (but has only a 4:1 compression ratio) is ADPCM, aka ima4. It's handled through the ExtAudioFile interface and is only the tiniest bit slower than loading .wav's directly.

可是我不能没有你 2024-07-20 15:51:48

您可以使用一些不错的开源音频解码库:

两者均获得 LGPL 许可,这意味着您可以在闭源应用程序中使用它们,前提是对库的修改(如果有)是开源的。

There are some good open source audio decoding libraries that you could use:

Both are licensed under LGPL, meaning you can use them in closed source applications provided modifications to the library, if any, are open sourced.

厌倦 2024-07-20 15:51:48

您始终可以将波形文件设为单声道,从而将波形文件大小减半。 但这可能不是您的最佳选择

You could always make your wave files mono and hence cut your wave file size in half. But that might not be the best alternative for you

梦情居士 2024-07-20 15:51:48

自行解码的另一个选择是 Ogg Vorbis。 他们的整数处理器库甚至还有一个低内存版本,名为 "Tremor"。

Another option for doing your own decoding would be Ogg Vorbis. There's even a low-memory version of their library for integer processors called "Tremor".

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