开发者

Does Core Audio / OpenAL resample audio files?

开发者 https://www.devze.com 2023-01-24 09:06 出处:网络
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

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 gues开发者_如何学Gosing 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?


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.)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消