You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Signal
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
8 years ago
..
AudioFiles Fixes #244 10 years ago
Certificates TextSecureKit Refactoring 10 years ago
Fonts Align the message state indicators with the behavior on Android and desktop. 8 years ago
Images Multiple visual enhancements and repo cleanup. 10 years ago
Images.xcassets pixel cleanup in bluetooth speaker image 8 years ago
src Use recommended approach for speakerphone mode 8 years ago
test Add comment and clearer tests per CR 8 years ago
translations extract dismiss string -> CommonStrings.dismissButton 8 years ago
.swiftlint.yml WIP: WebRTC calling 8 years ago
Signal-Info.plist Bump build from to 2.14.0.2. 8 years ago
Signal-Prefix.pch Always sync and log push tokens. Apply OWSAlerts in more places. 8 years ago
Signal.entitlements Choose arbitrary attachments from iCloud/GDrive/Dropbox/etc 8 years ago
iTunesArtwork@3x.png Updated iTunes artwork 10 years ago
main.m Removing unused imported classes. 10 years ago