1

There is not much documentation online about this because it's an odd task. I am trying to record my screen, the internal microphone, and the system audio at the same time using ReplayKit.

Here is how I am recording my screen right now:

    if([self.screenRecorder isAvailable]){
        [self.screenRecorder setMicrophoneEnabled:YES];
        [self.screenRecorder startRecordingWithHandler:nil];
    }

When this runs, the user is prompted to record with the microphone, or without the microphone. Could I possibly do both? Is there a workaround? If I choose microphone, when my app plays sound, the microphone gets disabled.

If anyone could propose a possible solution that does not involve replaykit, that would be greatly appreciated too!

Thanks

evenodd
  • 2,026
  • 4
  • 26
  • 38

2 Answers2

2

yes, it's possible, you can using AVAudioEngine which provide manual rendering mode, two playerNode (audio app, audio mic) into mixerNode and render.

PatrickSCLin
  • 1,419
  • 3
  • 17
  • 45
-1

So after looking into this you can also just do this very simply using the AVAudioSession API:

let audioSession = AVAudioSession.sharedInstance()
try! audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord, with: AVAudioSessionCategoryOptions.mixWithOthers)
milohoffman
  • 287
  • 1
  • 11
  • Not working, It only records the audio via mic, speaker audio is not getting recorded with this category option. – Saif Oct 29 '18 at 09:36