How to record video and play audio at the same time (swift tutorial)

前端 未结 2 1974
栀梦
栀梦 2021-02-06 10:33

So you want to record a video and play music from the user\'s library at the same time? Look no further. Below is the answer.<

2条回答
  •  故里飘歌
    2021-02-06 11:31

    Once you set the AVAudioSession just like below, it'd work well.

    try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.videoRecording, options: AVAudioSession.CategoryOptions.mixWithOthers)

提交回复
热议问题