mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
b8ec353d77
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 |
||
---|---|---|
.. | ||
call | ||
contact | ||
crypto | ||
environment | ||
Jobs | ||
Models | ||
network | ||
Observers | ||
Storyboard | ||
UserInterface | ||
util | ||
ViewControllers | ||
views | ||
AppDelegate.h | ||
AppDelegate.m | ||
ProfileFetcherJob.swift | ||
Signal-Bridging-Header.h | ||
UIApplication+OWS.swift | ||
UIColor+OWS.h | ||
UIColor+OWS.m | ||
UIDevice+featureSupport.swift | ||
UIStoryboard+OWS.swift | ||
UIView+OWS.h | ||
UIView+OWS.m |