fixing audioo not playing out loud

This commit is contained in:
talksik
2021-12-25 17:46:02 -08:00
parent 9bea58dbff
commit 2a170cdaaa
@@ -25,10 +25,11 @@ class InnerCircleViewModel: ObservableObject {
init() { init() {
// separate set up for listening vs recording // separate set up for listening vs recording
do { do {
try audioSession.setCategory(.playAndRecord, mode: .voiceChat, options: [.duckOthers, .allowBluetooth, .allowBluetoothA2DP]) try audioSession.setCategory(.playAndRecord, mode: .default, options: [.duckOthers, .allowBluetooth, .allowBluetoothA2DP])
try audioSession.setActive(true) try audioSession.setActive(true)
try audioSession.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker) // allow playing in silent mode
try audioSession.setAllowHapticsAndSystemSoundsDuringRecording(true) try audioSession.setAllowHapticsAndSystemSoundsDuringRecording(true)
try audioSession.overrideOutputAudioPort(AVAudioSession.PortOverride.speaker) // allow playing in silent mode
} catch { } catch {
print("Can not setup the Recording") print("Can not setup the Recording")
} }