             }
         }
     }
+    
+    /// Sets whether SwiftyCam should enable background audio from other applications or sources 
+    
+    fileprivate func setBackgroundAudioPreference() {
+        guard allowBackgroundAudio == true else {
+            return
+        }
+        
+        do{
+            try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord,
+                                                            with: [.duckOthers, .defaultToSpeaker])
+
+            session.automaticallyConfiguresApplicationAudioSession = false
+        }
+        catch {
+            print("[SwiftyCam]: Failed to set background audio preference")
+            
+        }
+    }
 }
 
 extension SwiftyCamViewController : SwiftyCamButtonDelegate {

    
    public func endVideoRecording() {
        if self.movieFileOutput?.isRecording == true {
            self.isVideRecording = false
            movieFileOutput!.stopRecording()
            disableFlash()
            

    
    public var promptToAppPrivacySettings        = true
    
    /// Set whether SwiftyCam should allow background audio from other applications
    
    public var allowBackgroundAudio              = true
    
    
    // MARK: Public Get-only Variable Declarations
    
    /// Returns true if video is currently being recorded
    
    private(set) public var isVideoRecording      = false
    
    /// Returns true if the capture session is currently running
    
