-
Re: Why do AudioUnits only work at the hardware sample rate?
_LC Jan 15, 2019 12:06 PM (in response to dwrae)I am running into this, too.
We have set our app's internal AudioUnit to be called at 44100. So, that's the behavior where it calls with uneven buffersizes because it's resampling. This is working fine. But we got past that only to find that it breaks InterApp audio if the AVAudioSession sampleRate and IAA's sampling rate don't match! Do I have this correct?
Is there a way of making this configuration work (running internally at 44100 on a 48000 system), or do we have to truly support 48000 if we want to also host IAA on newer phones? I didn't see it documented anywhere... what's the official word?
Thanks!
-Louis
-
Re: Why do AudioUnits only work at the hardware sample rate?
hotpaw2 Jan 15, 2019 1:29 PM (in response to _LC)It appears that iPhone device models from the 6s onwards (currently?) have hardware that can only sample at 48000. You need an older iOS device to run at 44100, or do resampling as needed in the Audio Unit or the app to get a rate other than 48000.
-
Re: Why do AudioUnits only work at the hardware sample rate?
_LC Jan 15, 2019 2:47 PM (in response to hotpaw2)Right, but the issue is stranger- AudioUnitInitialize returns kAudioComponentErr_InvalidFormat if you attempt to instantiate an IAA at 44.1khz from an instance (our app) that's already running at 44.1khz on a 48khz device. So, the OS appears to be disallowing instantiating the IAA at 44.1 even though the rest of the application is already fine at 44.1 on this 48khz-native device... AU v3 instances do appear to work fine.
-
Re: Why do AudioUnits only work at the hardware sample rate?
_LC Jan 17, 2019 11:04 AM (in response to _LC)I think I figured it out. It's not an OS limitation, just an easy oversight to make. In our case, we were setting the output stream format but not the input's, so the rates suddenly didn't match. Re-reading the OP's original question, maybe that's what they meant. In that case, you may be able to use a kAudioUnitType_FormatConverter and do the resampling within the host program. Hope this helps someone!
-
-
-