从 AVAudioPlayer 获取原始音频样本

发布于 2024-12-14 15:50:33 字数 228 浏览 2 评论 0原文

我正在使用 AVAudioPlayer 加载 .caf 文件,并且我想获取指向音频样本的指针。有什么办法可以做到这一点吗?我知道 AVAudioPlayer 有一个 NSData 属性,我假设它是从 .caf 文件读取的字节。我可以去掉 .caf 标头吗?我不认为样本以 LPCM 形式存储在 .caf 文件中,所以我觉得我必须进行转换。

有没有比使用 AVAudioPlayer 加载 .caf 文件并访问示例更简单的方法?

I'm loading in a .caf file with AVAudioPlayer, and I'd like to get at a pointer to the audio samples. Is there any way to go about doing this? I know AVAudioPlayer has an NSData property which I assume is the bytes read in from the .caf file. Could I just strip the .caf header? I don't think the samples are stored as LPCM in .caf files, so I feel like I'd have to convert.

Is there an easier method than using AVAudioPlayer to load up a .caf file and have access to the samples?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文