Open toddoh opened 8 years ago
The safest way I've found is to:
let sess = AVAudioSession.sharedInstance()
do {
try sess.setActive(false)
try sess.setCategory(AVAudioSessionCategoryPlayAndRecord, withOptions: [ .MixWithOthers, .DefaultToSpeaker ])
try sess.setMode(AVAudioSessionModeVideoRecording)
try sess.setActive(true)
} catch let error as NSError {
print("shared audio session error: \(error.localizedDescription)")
}
before you set the recorder's session and call startRunning
Thanks man!
I found multiple posts on here that disabling automaticallyConfiguresApplicationAudioSession (to NO) and adding AVAudioSession codes to AppDelegate would let SCRecorder to not pause background music. (https://github.com/rFlex/SCRecorder/issues/194#issuecomment-146440130)
However, when I disable that option, recorder stops working for video recording preset/mode, only photo mode works properly. I see that Snapchat and Vine supports video recording even with bg music playing.
Is there any solution for this?