mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Remove dependency on AppAudioManager
Implement speakerphone toggle directly. Previously we were using AppAudioManager for several things, but this is that last lingering bit. Much of the AppAudioManager code is based on RedPhone calling, so by removing the dependency we pave the way to throw that code away. // FREEBIE
This commit is contained in:
parent
4374e431a2
commit
4c23b5e23f
|
@ -7,7 +7,6 @@ import Foundation
|
|||
@objc class CallAudioService: NSObject {
|
||||
private let TAG = "[CallAudioService]"
|
||||
private var vibrateTimer: Timer?
|
||||
private let audioManager = AppAudioManager.sharedInstance()
|
||||
private let soundPlayer = JSQSystemSoundPlayer.shared()!
|
||||
|
||||
enum SoundFilenames: String {
|
||||
|
@ -98,16 +97,11 @@ import Foundation
|
|||
}
|
||||
|
||||
private func handleUpdatedSpeakerphone() {
|
||||
// TODO
|
||||
// let category = AVAudioSession.sharedInstance().getCategory()
|
||||
// if isSpeakerphoneEnabled {
|
||||
// AVAudioSession.sharedInstance().setCategory(category, option: AVAudioSessionCategoryOptionDefaultToSpeaker)
|
||||
// } else {
|
||||
// Will this disable speaker?
|
||||
// AVAudioSession.sharedInstance().setCategory(category)
|
||||
// }
|
||||
|
||||
audioManager.toggleSpeakerPhone(isEnabled: isSpeakerphoneEnabled)
|
||||
if isSpeakerphoneEnabled {
|
||||
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord, options: .defaultToSpeaker)
|
||||
} else {
|
||||
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Helpers
|
||||
|
|
Loading…
Reference in a new issue