Core Audio / OpenAL 是否会对音频文件重新采样?
我注意到,如果我的音频文件采用 caf 11250Hz 单声道,它们的性能会比 44.1Khz 单声道差。使用探查器跟踪它,我可以看到,对于低采样率文件,最长的跟踪之一以 LinearConverterInt32 结尾。这在 44.1KHz 迹线中不存在。
我想使用较低的采样率文件来减小文件大小(希望还有内存大小)。
我在我的日志文件中注意到我得到了这个 AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24 位小端有符号整数,去交错
所以我猜测这是它要转换成的格式,但我不知道如何告诉它使用 1通道,11250 Hz 16 位。
想法?
I've noticed that if my audio files are in caf 11250Hz mono they perform worse than 44.1Khz mono. Tracing it with profiler I can see that for the low sample rate files one of the longest traces ends with LinearConverterInt32. This isn't present in the 44.1KHz trace.
I want to use the lower sample rate files to keep file size (and hopefully memory size) down.
I've noticed in my log file that I get this
AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
So I am guessing that this is the format it is converting to, but I have no idea how to tell it to use 1 ch, 11250 Hz 16 bit.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,Core Audio 可以重新采样,并且可能确实如此,因为应用程序无法控制实际的硬件采样率。操作系统确实如此,可能取决于设备类型、操作系统版本、应用程序的音频会话类型以及之前运行或当前在后台运行的任何其他应用程序(和/或月相等) .)
Yes, Core Audio can resample, and probably does, as an app does not have control over the actual hardware sample rate. The OS does, probably depending on the device type, the OS version, the audio session type of your app and any other apps that have previously run or are currently in the background (and/or the phase-of-the-moon, etc.)
如果您想节省内存,则应使用以 CAF 文件格式通过 IMA 4:1 压缩的 44.1 kHz 音频。不过,它确实会引入一些噪音,因此您应该进行一些听力测试,看看它是否适合您。
If you want to conserve memory, you should use 44.1 kHz audio compressed with IMA 4:1 in CAF file format. It does introduce some noise, though, so you should do some listening test to see if it's right for you.