Search code examples
iosaudioaudiounit

In iOS, are we able to intercept/transform microphone audio before it is passed to other apps?


I wish to create an app that will preprocess microphone input before sending it on to the rest of the system.

Something like this:

[Mic Audio Unit] -> (...)

[Mic Audio Unit] -> [My app transforms audio] -> (...)

Now my guess is that this is most likely impossible on iOS. My guess is that any app can access raw microphone input, and that apps aren't allowed system-level permissions on the audio pipeline.

But I'm not sure, and I can't find a definitive yes or no anywhere.


Solution

  • The stock iOS security sandbox does not allow an app to intercept audio to other apps. An app can write to its audio input buffers, but these audio input buffers are private between iOS and each apps, and not visible to other apps (as each app can have its own audio input buffer format, data type, and sample rate, etc.). There is an old deprecated inter-app audio API still available in iOS, but all apps involved have to include and participate in this API to exchange audio data.