使用 Core Audio 从 AIFF 中提取浮点数
有没有办法在 OS X 上使用 Core Audio 将 AIFF 文件中的一组帧提取到适合执行 FFT 的 32 位浮点数组中?
Is there a way using Core Audio on OS X to extract a set of frames in an AIFF file into an array of 32-bit floats suitable for performing an FFT on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

是的。最简单的方法是使用 ExtAudioFile API。 Apple 的 ConvertFile 示例代码中有一个很好的示例。查看 UseExtAF.cpp。
对于 44.1 kHz 的采样率,32 位浮点 LPCM 的 AudioStreamBasicDescription 如下所示:
Yes. The easiest way to do it is to use the ExtAudioFile API. There's a great example in Apple's ConvertFile sample code. Have a look at UseExtAF.cpp.
For a sample rate of 44.1 kHz, the AudioStreamBasicDescription for 32-bit floating point LPCM would look like this: