AWSLexAudioSession
Objective-C
@interface AWSLexAudioSession : NSObject
Swift
class AWSLexAudioSession : NSObject
Wrapper to AVAudioSession class. It auto-detects output source(Internal speaker or microphone) at runtime by listening to AVAudioSessionRouteChangeNotification.
-
Undocumented
Declaration
Objective-C
+ (instancetype)sharedInstance;Swift
class func sharedInstance() -> Self -
Set AVAudioSession category to AVAudioSessionCategoryPlayAndRecord
Declaration
Objective-C
- (void)setPlayAndRecordCategory:(NSError *_Nullable *_Nullable)outError;Swift
func setPlayAndRecordCategory(_ outError: NSErrorPointer) -
Override output audio port to AVAudioSessionPortOverrideSpeaker if headset is not detected.
Declaration
Objective-C
- (void)overrideOutputAudioPort:(NSError *_Nullable *_Nullable)outError;Swift
func overrideOutputAudioPort(_ outError: NSErrorPointer) -
Request record permission to AVAudioSession.
Declaration
Objective-C
- (void)requestRecordPermission:(nonnull void (^)(BOOL))response;Swift
func requestRecordPermission(_ response: @escaping (Bool) -> Void) -
Start observing for AVAudioSessionRouteChangeNotification if not already started.
Declaration
Objective-C
- (void)startObservingAudioSessionRouteChangeNotification;Swift
func startObservingAudioSessionRouteChangeNotification() -
Remove observing for AVAudioSessionRouteChangeNotification.
Declaration
Objective-C
- (void)endObservingAudioSessionRouteChangeNotification;Swift
func endObservingAudioSessionRouteChangeNotification()
View on GitHub
Install in Dash
AWSLexAudioSession Class Reference