Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ios/AudioRecorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ public class AudioRecorder: NSObject, AVAudioRecorderDelegate{
AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue
]

let options: AVAudioSession.CategoryOptions = [.defaultToSpeaker, .allowBluetooth, .mixWithOthers]
// Don't pass .mixWithOthers when configuring an audio-recording session:
// mixing means other apps (Spotify, Apple Music, Podcasts, …) keep
// playing through the speaker while recording, and that audio bleeds
// straight into the recorded file via the device microphone. Starting
// a recording should interrupt other audio so the mic captures only the
// user's voice.
let options: AVAudioSession.CategoryOptions = [.defaultToSpeaker, .allowBluetooth]

if (path == nil) {
guard let newPath = self.createAudioRecordPath(fileNameFormat: fileNameFormat) else {
Expand Down
Loading