session-ios/Signal/src
Michael Kirk b8ec353d77 Use recommended approach for speakerphone mode
From: https://developer.apple.com/library/content/qa/qa1754/_index.html

Q:  Can you explain the difference between calling the AVAudioSession method overrideOutputAudioPort: with the value AVAudioSessionPortOverrideSpeaker and using the category option AVAudioSessionCategoryOptionDefaultToSpeaker with setCategory:withOptions:error:.

A: The difference is that setting the AVAudioSessionPortOverride by calling overrideOutputAudioPort: is more transient than using the category option AVAudioSessionCategoryOptionDefaultToSpeaker.

Important: The use of both AVAudioSessionPortOverrideSpeaker and AVAudioSessionCategoryOptionDefaultToSpeaker are only applicable to the AVAudioSessionCategoryPlayAndRecord category.
Calling overrideOutputAudioPort: and setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker is a way of temporarily overriding the output to play to the speaker. Any route change or interruption will cause the audio to be routed back to its normal route, following the last-in wins rule. Think of using overrideOutputAudioPort: in terms of what you might use to implement a Speakerphone button where you want to be able to toggle between the speaker (AVAudioSessionPortOverrideSpeaker) and the normal output route (AVAudioSessionPortOverrideNone).

Note: This property is intended to allow 3rd party applications to mimic the behavior of a Speakerphone button and therefore may change the input route as well as output route. For example, setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker while a headset is plugged in will cause the route to change to built-in mic / built-in speaker.

// FREEBIE
2017-07-14 09:49:48 -04:00
..
call Use recommended approach for speakerphone mode 2017-07-14 09:49:48 -04:00
contact Respond to CR. 2017-07-12 13:47:29 -04:00
crypto Remove some more RP related code 2017-03-30 11:00:28 -04:00
environment Fix broken tests. 2017-07-12 12:14:15 -04:00
Jobs Fix “timer circular reference” leaks. 2017-07-07 15:17:18 -04:00
Models Respond to CR. 2017-07-12 13:18:03 -04:00
network Respect disappearing message timer from lockscreen 2017-07-14 09:48:46 -04:00
Observers Read receipts remove lockscreen notifications 2016-09-17 13:51:33 -04:00
Storyboard Convert home view to programmatic layout. 2017-07-11 16:01:19 -04:00
UserInterface extract dismiss string -> CommonStrings.dismissButton 2017-07-13 17:08:41 -04:00
util Respect disappearing message timer from lockscreen 2017-07-14 09:48:46 -04:00
ViewControllers Fix another call view leak. 2017-07-13 18:14:26 -04:00
views extract dismiss string -> CommonStrings.dismissButton 2017-07-13 17:08:41 -04:00
AppDelegate.h Convert home view to programmatic layout. 2017-07-11 16:01:19 -04:00
AppDelegate.m Add a reminder that you are in archive view. 2017-07-11 16:01:19 -04:00
ProfileFetcherJob.swift Add owsFail free function for swift. 2017-07-11 16:20:20 -04:00
Signal-Bridging-Header.h fix bubble calculator tests 2017-07-11 16:36:50 -04:00
UIApplication+OWS.swift Respond to CR. 2017-07-06 13:20:21 -04:00
UIColor+OWS.h Rework appearance of voice messages and audio attachments. 2017-05-12 09:46:54 -04:00
UIColor+OWS.m Respond to CR. 2017-05-12 09:49:12 -04:00
UIDevice+featureSupport.swift one-time carousel of changes 2017-03-02 14:37:50 -05:00
UIStoryboard+OWS.swift Convert FingerprintViewController to programmatic layout. 2017-06-08 14:55:26 -04:00
UIView+OWS.h Convert FingerprintViewController to programmatic layout. 2017-06-08 14:55:26 -04:00
UIView+OWS.m Convert FingerprintViewController to programmatic layout. 2017-06-08 14:55:26 -04:00