Revert "Merge branch 'charlesmchen/bluetoothAudio'"

This reverts commit 48a2005aa2, reversing
changes made to de1332479c.

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent b76c3fb1c6
commit 17cff1a26d

@ -3148,9 +3148,7 @@ typedef enum : NSUInteger {
OWSAssert(session.recordPermission == AVAudioSessionRecordPermissionGranted);
NSError *error;
[session setCategory:AVAudioSessionCategoryRecord
withOptions:AVAudioSessionCategoryOptionAllowBluetooth
error:&error];
[session setCategory:AVAudioSessionCategoryRecord error:&error];
if (error) {
DDLogError(@"%@ Couldn't configure audio session: %@", self.tag, error);
[self cancelVoiceMemo];

@ -105,8 +105,7 @@ import AVFoundation
options: .defaultToSpeaker)
} else {
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord,
mode: AVAudioSessionModeVoiceChat,
options: [.allowBluetooth])
mode: AVAudioSessionModeVoiceChat)
}
}
@ -151,7 +150,7 @@ import AVFoundation
} else {
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord,
mode: AVAudioSessionModeVoiceChat,
options: [.mixWithOthers, .allowBluetooth])
options: .mixWithOthers)
}
// HACK: Without this async, dialing sound only plays once. I don't really understand why. Does the audioSession
@ -300,8 +299,6 @@ import AVFoundation
private func setAudioSession(category: String,
mode: String? = nil,
options: AVAudioSessionCategoryOptions = AVAudioSessionCategoryOptions(rawValue: 0)) {
assert(Thread.isMainThread)
do {
if #available(iOS 10.0, *), let mode = mode {
try AVAudioSession.sharedInstance().setCategory(category, mode: mode, options: options)

Loading…
Cancel
Save