cn.tee3.avd_SDK-Objectc
2.1.0
|
Proxy class for AVAudioSession that adds a locking mechanism similar to AVCaptureDevice. 更多...
构造函数 | |
(void) | - addDelegate: |
Adds a delegate, which is held weakly. 更多... | |
(void) | - removeDelegate: |
Removes an added delegate. 更多... | |
(void) | - lockForConfiguration |
Request exclusive access to the audio session for configuration. 更多... | |
(void) | - unlockForConfiguration |
Relinquishes exclusive access to the audio session. 更多... | |
(BOOL) | - setActive:error: |
If |active|, activates the audio session if it isn't already active. 更多... | |
(BOOL) | - setActive:withOptions:error: |
(BOOL) | - setCategory:withOptions:error: |
(BOOL) | - setMode:error: |
(BOOL) | - setInputGain:error: |
(BOOL) | - setPreferredSampleRate:error: |
(BOOL) | - setPreferredIOBufferDuration:error: |
(BOOL) | - setPreferredInputNumberOfChannels:error: |
(BOOL) | - setPreferredOutputNumberOfChannels:error: |
(BOOL) | - overrideOutputAudioPort:error: |
(BOOL) | - setPreferredInput:error: |
(BOOL) | - setInputDataSource:error: |
(BOOL) | - setOutputDataSource:error: |
类方法 | |
(instancetype) | + sharedInstance |
Default constructor. 更多... | |
属性 | |
AVAudioSession * | session |
Convenience property to access the AVAudioSession singleton. 更多... | |
BOOL | isActive |
Our best guess at whether the session is active based on results of calls to AVAudioSession. 更多... | |
BOOL | isLocked |
Whether RTCAudioSession is currently locked for configuration. 更多... | |
NSString * | category |
AVAudioSessionCategoryOptions | categoryOptions |
NSString * | mode |
BOOL | secondaryAudioShouldBeSilencedHint |
AVAudioSessionRouteDescription * | currentRoute |
NSInteger | maximumInputNumberOfChannels |
NSInteger | maximumOutputNumberOfChannels |
float | inputGain |
BOOL | inputGainSettable |
BOOL | inputAvailable |
NSArray * | inputDataSources |
AVAudioSessionDataSourceDescription * | inputDataSource |
NSArray<AVAudioSessionDataSourceDescription *> * inputDataSources; 更多... | |
NSArray * | outputDataSources |
AVAudioSessionDataSourceDescription * | outputDataSource |
NSArray<AVAudioSessionDataSourceDescription *> * outputDataSources; 更多... | |
double | sampleRate |
NSInteger | inputNumberOfChannels |
NSInteger | outputNumberOfChannels |
float | outputVolume |
NSTimeInterval | inputLatency |
NSTimeInterval | outputLatency |
NSTimeInterval | IOBufferDuration |
Proxy class for AVAudioSession that adds a locking mechanism similar to AVCaptureDevice.
This is used to that interleaving configurations between WebRTC and the application layer are avoided. Only setter methods are currently proxied. Getters can be accessed directly off AVAudioSession.
RTCAudioSession also coordinates activation so that the audio session is activated only once. See |setActive:error:|.
- (void) addDelegate: | (id< RTCAudioSessionDelegate >) | delegate |
Adds a delegate, which is held weakly.
Even though it's held weakly, callers should still call |removeDelegate| when it's no longer required to ensure proper dealloc. This is due to internal use of an NSHashTable.
- (void) lockForConfiguration |
Request exclusive access to the audio session for configuration.
This call will block if the lock is held by another object.
- (BOOL) overrideOutputAudioPort: | (AVAudioSessionPortOverride) | portOverride | |
error: | (NSError **) | outError | |
- (void) removeDelegate: | (id< RTCAudioSessionDelegate >) | delegate |
Removes an added delegate.
- (BOOL) setActive: | (BOOL) | active | |
error: | (NSError **) | outError | |
If |active|, activates the audio session if it isn't already active.
Successful calls must be balanced with a setActive:NO when activation is no longer required. If not |active|, deactivates the audio session if one is active and this is the last balanced call. When deactivating, the AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation option is passed to AVAudioSession.
- (BOOL) setActive: | (BOOL) | active | |
withOptions: | (AVAudioSessionSetActiveOptions) | options | |
error: | (NSError **) | outError | |
- (BOOL) setCategory: | (NSString *) | category | |
withOptions: | (AVAudioSessionCategoryOptions) | options | |
error: | (NSError **) | outError | |
- (BOOL) setInputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setInputGain: | (float) | gain | |
error: | (NSError **) | outError | |
- (BOOL) setMode: | (NSString *) | mode | |
error: | (NSError **) | outError | |
- (BOOL) setOutputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInput: | (AVAudioSessionPortDescription *) | inPort | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredIOBufferDuration: | (NSTimeInterval) | duration | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredOutputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredSampleRate: | (double) | sampleRate | |
error: | (NSError **) | outError | |
+ (instancetype) sharedInstance |
Default constructor.
Do not call init.
- (void) unlockForConfiguration |
Relinquishes exclusive access to the audio session.
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
NSArray<AVAudioSessionDataSourceDescription *> * inputDataSources;
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readnonatomicassign |
Our best guess at whether the session is active based on results of calls to AVAudioSession.
|
readnonatomicassign |
Whether RTCAudioSession is currently locked for configuration.
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
NSArray<AVAudioSessionDataSourceDescription *> * outputDataSources;
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readnonatomicassign |
Convenience property to access the AVAudioSession singleton.
Callers should not call setters on AVAudioSession directly, but other method invocations are fine.