Is there any supported API for a third party app to access live audio from a call it isn't itself carrying?
Is there any supported API for a third party app to access live audio from a call it isn't itself carrying?
Is there any supported API for a third-party app to access live audio from a call it isn't itself carrying?
No. Alongside the obvious privacy and security issues, at a purely technical level, each CallKit app actually controls and manages[1] its own audio stream, so the system doesn't actually have any special/unusual access to the stream. While it is theoretically possible to "fork" audio streams and send them to different sources, that isn't really part of the iOS system and it CERTAINLY isn't available to the audio system. In addition, there are major differences between "the call" the user experienced and what actually happened on the device. Notably:
-
There are two audio streams (one playing, one recording) which are actually running independently of each other, not a single unified "call stream".
-
CallKit presents calls as individual entities which can be individually interacted with (for example, "muting a call"), but that's NOT how their audio streams are actually handled. At the app level, there are simply two audio streams (playback and recording), which that app is using to push audio out. So, for example, when you switch between two calls, the app receives a message saying that you "switched calls" and then switches what data it was routing to its audio pipes. Nothing really changes in the audio system itself.
One thing that’s helpful to understand here is that CallKit is best understood as an (admittedly odd) user interface framework like UIKit, NOT a "calling framework". It is loosely entangled with the audio system (allowing it to do things like mute and session activation), but it doesn't actually control or "understand" how apps are using it.
[1] callservicesd uses SPI to activate the app’s AudioSession from outside the process, but doesn't actually have any access to the audio data itself.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware