1
    var recordingSession : AVAudioSession!

    recordingSession = AVAudioSession.sharedInstance()

     try recordingSession.setCategory(AVAudioSessionCategoryPlayAndRecord, mode: AVAudioSessionModeDefault, options: [.allowBluetoothA2DP, .allowBluetooth, .defaultToSpeaker])

AirPod is connected playing music but no recording.

I tried to setPreferredInput to AVAudioSession. But that too didn't worked.

Thanks in advance.

  • You can follow this Link, may be it will work for you. https://stackoverflow.com/questions/46231219/avcapturesession-and-avaudiosession-recording-video-while-background-music-playi – Aayushi Jun 27 '18 at 07:28

0 Answers0