I am trying to use RPScreenRecorder startCaptureWithHandler:completionHandler: api on my iPad with iOS 11.4 to grab audio and video directly. It works well with the app screen, app audio and the camera, but when I turn on the microphone using microphoneEnabled = YES, I never get any audio sample for the mic in the callback.
I added the microphone privacy usage key in the info.plist but that did not help.
I am not sure what I can do next to try to resolve this issue.
Thanks.
This code gets me audio buffers containing actual microphone audio (even without a microphone usage string or audio session configuration):
There's a permission dialog that asks whether you Allow Screen & Microphone, Allow Screen Only, or don't allow. Is it possible you tapped screen-only? N.B. I don't know how to reset this dialog.
The other possibility is that you're setting
microphoneEnabled
after you start capturing? That might not work. Nah, that works for me too.Previous guess
You might need to activate a recording
AVAudioSession
: