Skip to content

SNTXAudio

Ju Liaoyuan edited this page Dec 20, 2022 · 1 revision

SNTXAudio Class Reference

  Inherits from SNAudio :
NSObject
  Declared in SNTXAudio.h

SNTXAudio.m

Tasks

Other Methods

– initWithConfigModel:

– updateConfigModel:

– enter

– reEnter

– beenEntered

– leave

– startPublishWithId:

– stopPublish

– startPullWithId:

– startPullWithIdArr:

– startPullAllId

– stopPullWithId:

– stopPullWithIdArr:

– stopPullAllId

– enableMic

– unableMic

– enableSpeaker

– unableSpeaker

– muteWithId:

– unMuteWithId:

– muteWithIdArr:

– unMuteWithIdArr:

– isPullingWithId:

– pullingAccIdSet

– allStreamSet

– isPullingSignal

– isPublishingSignal

– isPublishing

– uploadSDKLog

– enableLoopback

– disableLoopback

– setReverbMode:

– setStreamRenderView:

– getCaptureVolume

– setCaptureVolume:

– setLoopbackVolume:

– setDeviceMode:

– setAudioPrep:

– removeAudioPrep:

– volumeSubject

– disconnectSubject

– reconnectSubject

– publishEventCallback

– voiceApertureSubject

– onReceiveMediaSideInfo

– videoFirstRenderCallback

– onPullStreamFail

– onKickOutRoom

– onPullStreamSuccess

– onPublishStreamSuccess

– onNeedCheckConfig

Extension Methods

  volumeSubject property

  voiceApertureSubject property

  disconnectSubject property

  reconnectSubject property

  onReceiveMediaSideInfo property

  videoFirstRenderCallback property

  onPublishStreamSuccess property

  onPullStreamFail property

  onPullStreamSuccess property

  onNeedCheckConfig property

  onKickOutRoom property

Properties

disconnectSubject

音频断开连接

@property (nonatomic, strong) RACSubject *disconnectSubject

Discussion

音频断开连接

Declared In

  • SNAudio.h

onKickOutRoom

被踢出房间

@property (nonatomic, strong) RACSubject *onKickOutRoom

Discussion

被踢出房间

Declared In

  • SNAudio.h

onNeedCheckConfig

拉流出错时,内部判定需要检查当前配置的回调。

@property (nonatomic, strong) RACSubject *onNeedCheckConfig

Return Value

true

Discussion

拉流出错时,内部判定需要检查当前配置的回调。

Declared In

  • SNAudio.h

onPublishStreamSuccess

推流成功

@property (nonatomic, strong) RACSubject *onPublishStreamSuccess

Return Value

streamId

Discussion

推流成功

Declared In

  • SNAudio.h

onPullStreamFail

拉流失败,内部已经尝试重试但无法恢复,需要调用方主动发起重试。

@property (nonatomic, strong) RACSubject *onPullStreamFail

Return Value

元组,第一个值为sdkCode, 第二个值为一个json对象:streamType: 流类型(1:混流,2:单流) streamId: 流id

Discussion

拉流失败,内部已经尝试重试但无法恢复,需要调用方主动发起重试。

Declared In

  • SNAudio.h

onPullStreamSuccess

拉流成功

@property (nonatomic, strong) RACSubject *onPullStreamSuccess

Return Value

streamId

Discussion

拉流成功

Declared In

  • SNAudio.h

onReceiveMediaSideInfo

收到 SEI 消息回调

@property (nonatomic, strong) RACSubject *onReceiveMediaSideInfo

Discussion

收到 SEI 消息回调

Declared In

  • SNAudio.h

reconnectSubject

音频重新连接成功

@property (nonatomic, strong) RACSubject *reconnectSubject

Discussion

音频重新连接成功

Declared In

  • SNAudio.h

videoFirstRenderCallback

视频模式下,第一次开始渲染视频时的回调

@property (nonatomic, strong) RACSubject *videoFirstRenderCallback

Discussion

视频模式下,第一次开始渲染视频时的回调

Declared In

  • SNAudio.h

voiceApertureSubject

他人说话光圈回调

@property (nonatomic, strong) RACSubject *voiceApertureSubject

Discussion

他人说话光圈回调

Declared In

  • SNAudio.h

volumeSubject

推流音量回调

@property (nonatomic, strong) RACSubject *volumeSubject

Discussion

推流音量回调

Declared In

  • SNAudio.h

Instance Methods

allStreamSet

获取房间内所有流集合

- (NSSet<NSString*> *)allStreamSet

Discussion

获取房间内所有流集合

Declared In

  • SNAudio.h

beenEntered

是否在语聊房房间中

- (BOOL)beenEntered

Discussion

是否在语聊房房间中

Declared In

  • SNAudio.h

disableLoopback

关闭耳返(仅支持有线耳机)

- (BOOL)disableLoopback

Discussion

关闭耳返(仅支持有线耳机)

Declared In

  • SNAudio.h

disconnectSubject

音频断开连接

- (RACSubject *)disconnectSubject

Discussion

音频断开连接

Declared In

  • SNAudio.h

enableLoopback

打开耳返(仅支持有线耳机)

- (BOOL)enableLoopback

Discussion

打开耳返(仅支持有线耳机)

Declared In

  • SNAudio.h

enableMic

打开麦克风

- (RACSignal *)enableMic

Discussion

打开麦克风

Declared In

  • SNAudio.h

enableSpeaker

使用扬声器

- (RACSignal *)enableSpeaker

Discussion

使用扬声器

Declared In

  • SNAudio.h

enter

进入音视频房间

- (RACSignal *)enter

Discussion

进入音视频房间

Declared In

  • SNAudio.h

getCaptureVolume

获取采集音量,范围[0, 200],默认100

- (NSInteger)getCaptureVolume

Discussion

获取采集音量,范围[0, 200],默认100

Declared In

  • SNAudio.h

initWithConfigModel:

初始化配置

- (instancetype)initWithConfigModel:(SNConfigModel *)*configModel*

Parameters

configModel
   后台下发配置, @see SNConfigModel

Discussion

初始化配置

Declared In

  • SNAudio.h

isPublishing

是否正在推流,同步回调

- (BOOL)isPublishing

Discussion

是否正在推流,同步回调

Declared In

  • SNAudio.h

isPublishingSignal

是否正在推流,异步回调

- (RACSignal *)isPublishingSignal

Discussion

是否正在推流,异步回调

Declared In

  • SNAudio.h

isPullingSignal

是否正在拉流

- (RACSignal *)isPullingSignal

Discussion

是否正在拉流

Declared In

  • SNAudio.h

isPullingWithId:

是否正在拉取该流

- (BOOL)isPullingWithId:(NSString *)*idStr*

Parameters

idStr
   流id

Discussion

是否正在拉取该流

Declared In

  • SNAudio.h

leave

离开音视频频房间

- (RACSignal *)leave

Discussion

离开音视频频房间

Declared In

  • SNAudio.h

muteWithId:

静音某条流

- (RACSignal *)muteWithId:(NSString *)*stream*

Parameters

idStr
   Id

Discussion

静音某条流

Declared In

  • SNAudio.h

muteWithIdArr:

静音多条流

- (RACSignal *)muteWithIdArr:(NSArray<NSString*> *)*idArr*

Parameters

idArr
   streamId 或 accId

Discussion

静音多条流

Declared In

  • SNAudio.h

onKickOutRoom

被踢出房间

- (RACSubject *)onKickOutRoom

Discussion

被踢出房间

Declared In

  • SNAudio.h

onNeedCheckConfig

拉流出错时,内部判定需要检查当前配置的回调。

- (RACSubject *)onNeedCheckConfig

Return Value

true

Discussion

拉流出错时,内部判定需要检查当前配置的回调。

Declared In

  • SNAudio.h

onPublishStreamSuccess

推流成功

- (RACSubject *)onPublishStreamSuccess

Return Value

streamId

Discussion

推流成功

Declared In

  • SNAudio.h

onPullStreamFail

拉流失败,内部已经尝试重试但无法恢复,需要调用方主动发起重试。

- (RACSubject *)onPullStreamFail

Return Value

元组,第一个值为sdkCode, 第二个值为一个json对象:streamType: 流类型(1:混流,2:单流) streamId: 流id

Discussion

拉流失败,内部已经尝试重试但无法恢复,需要调用方主动发起重试。

Declared In

  • SNAudio.h

onPullStreamSuccess

拉流成功

- (RACSubject *)onPullStreamSuccess

Return Value

streamId

Discussion

拉流成功

Declared In

  • SNAudio.h

onReceiveMediaSideInfo

收到 SEI 消息回调

- (RACSubject *)onReceiveMediaSideInfo

Discussion

收到 SEI 消息回调

Declared In

  • SNAudio.h

publishEventCallback

推流事件回调,事件参考 @see SNPublishEvent

- (RACSubject *)publishEventCallback

Discussion

推流事件回调,事件参考 @see SNPublishEvent

Declared In

  • SNAudio.h

pullingAccIdSet

获取正在拉取流的accId 集合

- (NSSet<NSString*> *)pullingAccIdSet

Discussion

获取正在拉取流的accId 集合

Declared In

  • SNAudio.h

reEnter

重新进入音频房间

- (RACSignal *)reEnter

Discussion

重新进入音频房间

Declared In

  • SNAudio.h

reconnectSubject

音频重新连接成功

- (RACSubject *)reconnectSubject

Discussion

音频重新连接成功

Declared In

  • SNAudio.h

removeAudioPrep:

移除音频预处理

- (void)removeAudioPrep:(id<SNAudioPrepProtocol>)*processor*

Discussion

移除音频预处理

Declared In

  • SNAudio.h

setAudioPrep:

设置音频预处理类

- (void)setAudioPrep:(id<SNAudioPrepProtocol>)*processor*

Parameters

processor
   必须实现 @see SNAudioPrepProtocol 需保证在"推拉流/媒体播放器播放"前设置,推拉流后再次设置无效

Discussion

设置音频预处理类

Declared In

  • SNAudio.h

setCaptureVolume:

设置采集音量,范围[0, 200]

- (void)setCaptureVolume:(NSInteger)*volume*

Discussion

设置采集音量,范围[0, 200]

Declared In

  • SNAudio.h

setDeviceMode:

设置上麦模式

- (void)setDeviceMode:(SRDeviceMode)*mode*

Parameters

mode
   模式,参见 @see SRDeviceMode,默认是 SRDeviceModeGeneral

Discussion

设置上麦模式

Declared In

  • SNAudio.h

setLoopbackVolume:

设置耳返音量,范围[0, 200]

- (void)setLoopbackVolume:(NSInteger)*volume*

Discussion

设置耳返音量,范围[0, 200]

Declared In

  • SNAudio.h

setReverbMode:

设置音效

- (BOOL)setReverbMode:(SNVoiceReverbMode)*mode*

Parameters

mode
   参考 @see SNVoiceReverbMode

Return Value

是否设置成功

Discussion

设置音效

Declared In

  • SNAudio.h

setStreamRenderView:

设置拉流时渲染视频的 view 可以为空,为空时,代表不再渲染视频 Note: 内部不会强持有该 view,外部需自己做好生命周期管理

- (void)setStreamRenderView:(UIView *)*view*

Discussion

设置拉流时渲染视频的 view 可以为空,为空时,代表不再渲染视频 Note: 内部不会强持有该 view,外部需自己做好生命周期管理

Declared In

  • SNAudio.h

startPublishWithId:

开始推流

- (RACSignal *)startPublishWithId:(NSString *)*stream*

Parameters

idStr
   streamId或accId

Discussion

开始推流

Declared In

  • SNAudio.h

startPullAllId

拉取所有 streamId 或 accId

- (RACSignal *)startPullAllId

Discussion

拉取所有 streamId 或 accId

Declared In

  • SNAudio.h

startPullWithId:

开始拉流

- (RACSignal *)startPullWithId:(NSString *)*idStr*

Parameters

idStr
   streamId或accId

Discussion

开始拉流

Declared In

  • SNAudio.h

startPullWithIdArr:

拉多条流

- (RACSignal *)startPullWithIdArr:(NSArray<NSString*> *)*idArr*

Parameters

idArr
   streamId或accIds

Discussion

拉多条流

Declared In

  • SNAudio.h

stopPublish

停止推流

- (RACSignal *)stopPublish

Discussion

停止推流

Declared In

  • SNAudio.h

stopPullAllId

停止所有现正在拉取流

- (RACSignal *)stopPullAllId

Discussion

停止所有现正在拉取流

Declared In

  • SNAudio.h

stopPullWithId:

停止拉流

- (RACSignal *)stopPullWithId:(NSString *)*stream*

Parameters

idStr
   streamId或accId

Discussion

停止拉流

Declared In

  • SNAudio.h

stopPullWithIdArr:

停止拉多条流

- (RACSignal *)stopPullWithIdArr:(NSArray<NSString*> *)*streamsArr*

Parameters

idArr
   streamId或accId

Discussion

停止拉多条流

Declared In

  • SNAudio.h

unMuteWithId:

取消静音流

- (RACSignal *)unMuteWithId:(NSString *)*stream*

Parameters

idStr
   streamId或accId

Discussion

取消静音流

Declared In

  • SNAudio.h

unMuteWithIdArr:

取消静音多条流

- (RACSignal *)unMuteWithIdArr:(NSArray<NSString*> *)*idArr*

Parameters

idArr
   streamId或accId数组

Discussion

取消静音多条流

Declared In

  • SNAudio.h

unableMic

关闭麦克风

- (RACSignal *)unableMic

Discussion

关闭麦克风

Declared In

  • SNAudio.h

unableSpeaker

关闭扬声器, 使用听筒

- (RACSignal *)unableSpeaker

Discussion

关闭扬声器, 使用听筒

Declared In

  • SNAudio.h

updateConfigModel:

更新配置

- (RACSignal *)updateConfigModel:(SNConfigModel *)*configModel*

Parameters

configModel
   配置,@see SNConfigModel

Discussion

更新配置

Declared In

  • SNAudio.h

uploadSDKLog

上传第三方sdk log

- (RACSignal *)uploadSDKLog

Discussion

上传第三方sdk log

Declared In

  • SNAudio.h

videoFirstRenderCallback

视频模式下,第一次开始渲染视频时的回调

- (RACSubject *)videoFirstRenderCallback

Discussion

视频模式下,第一次开始渲染视频时的回调

Declared In

  • SNAudio.h

voiceApertureSubject

他人说话光圈回调

- (RACSignal *)voiceApertureSubject

Discussion

他人说话光圈回调

Declared In

  • SNAudio.h

volumeSubject

推流音量回调

- (RACSubject *)volumeSubject

Discussion

推流音量回调

Declared In

  • SNAudio.h
Clone this wiki locally