Allow access to the user microphone in an active phone call (not the other person on the line, only local)

For my app I want to build a SharePlay experience that uses the Speech framework. During a FaceTime call I want to perform Speech to text on the users device.

I tried to get this to work, but as soon as I’m on an active phonecall and I try to set the AudioSession, it doesn’t work. try AVAudioSession.sharedInstance().setCategory(.playAndRecord, options: . try AVAudioSession.sharedInstance().setActive(true, options: [])

I get the error: The operation couldn’t be completed. (OSStatus error 561017449.)

Which basically means: "The app was not allowed to set the audio category because another app (Phone, etc.) is controlling it."

It would be great if there was a way to get access to only the users microphone, not even the other person on the line so that it could be implemented in a privacy first way.

If there is a way to achieve this please let me know, Thanks Jordi

Replies

I've been looking into this more to find out how I can do this on the Mac instead of the phone.

I've found apps on the Mac App Store that allow for Speech to Text while a FaceTime call is active so I know that it's possible. But in all my testing I'm not able to get it to work. Any pointers would be great!