ByteRTCAudioScenarioType
typedef NS_ENUM(NSInteger, ByteRTCAudioScenarioType)
objectivec

音频场景类型。
选择音频场景后,SDK 会自动根据客户端音频采集播放设备和状态,适用通话音量/媒体音量。
如果以下音频场景类型无法满足你的业务需要,请联系技术支持人员。

枚举值
类型值说明
ByteRTCAudioScenarioMusic0(默认)音乐场景。
此场景适用于对音乐表现力有要求的场景,如音乐直播等。
音频采集播放设备和采集播放状态,到音量类型的映射如下:





不采集音频采集音频备注
设备自带麦克风和扬声器/听筒媒体音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机媒体音量媒体音量即使蓝牙耳机有麦克风,也只能使用设备自带麦克风进行本地音频采集。
ByteRTCAudioScenarioHighqualityCommunication1高质量通话场景。
此场景适用于对音乐表现力有要求,但又希望能够使用蓝牙耳机上自带的麦克风进行音频采集的场景。
此场景下,更倾向于使用媒体音量。由此,可能引起开关麦时音量突变。如不希望有此突变,请使用 ByteRTCAudioScenarioHighqualityChat。
此场景可以兼顾外放/使用蓝牙耳机时的音频体验,并避免使用蓝牙耳机时音量类型切换导致的听感突变。
音频采集播放设备和采集播放状态,到音量类型的映射如下:





不采集音频采集音频备注
设备自带麦克风和扬声器/听筒媒体音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机通话音量通话音量能够使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCAudioScenarioCommunication2纯通话音量场景。
此场景下,无论客户端音频路由情况和发布订阅状态,全程使用通话音量。
适用于需要频繁上下麦的通话或会议场景。
此场景可以保持统一的音频模式,不会有音量突变的听感;
最大程度地消除回声,使通话清晰度达到最优;
使用蓝牙耳机时,能够使用蓝牙耳机上自带的麦克风进行音频采集。
但是,会压低使用媒体音量进行播放的其他音频的音量,且音质会变差。
ByteRTCAudioScenarioMedia3纯媒体场景。一般不建议使用。
此场景下,无论客户端音频采集播放设备和采集播放状态,全程使用媒体音量。
外放通话时,可能出现回声和啸叫,请联系技术支持人员。
ByteRTCAudioScenarioGameStreaming4游戏媒体场景。
此场景下,蓝牙耳机时使用通话音量,其它设备使用媒体音量。
若外放通话且无游戏音效消除优化时音质不理想,请联系技术支持人员。
ByteRTCAudioScenarioHighqualityChat5高质量畅聊场景。

此场景和 ByteRTCAudioScenarioHighqualityCommunication 高度类似,唯一的差异在于:此场景下,在使用设备自带的麦克风和扬声器/听筒进行通话时,开关麦始终采用通话音量,不会引起音量类型突变。

音频采集播放设备和采集播放状态,到音量类型的映射如下:






不采集音频采集音频备注
设备自带麦克风和扬声器/听筒通话音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机通话音量通话音量能够使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCVoiceChangerType
typedef NS_ENUM(NSInteger, ByteRTCVoiceChangerType)
objectivec

变声特效类型

枚举值
类型值说明
ByteRTCVoiceChangerOriginal0原声,不含特效
ByteRTCVoiceChangerGiant1巨人
ByteRTCVoiceChangerChipmunk2花栗鼠
ByteRTCVoiceChangerMinionst3小黄人
ByteRTCVoiceChangerVibrato4颤音
ByteRTCVoiceChangerRobot5机器人
ByteRTCVoiceReverbType
typedef NS_ENUM(NSInteger, ByteRTCVoiceReverbType)
objectivec

混响特效类型

枚举值
类型值说明
ByteRTCVoiceReverbOriginal0原声,不含特效
ByteRTCVoiceReverbEcho1回声
ByteRTCVoiceReverbConcert2演唱会
ByteRTCVoiceReverbEthereal3空灵
ByteRTCVoiceReverbKTV4KTV
ByteRTCVoiceReverbStudio5录音棚
ByteRTCAudioProfileType
typedef NS_ENUM(NSInteger, ByteRTCAudioProfileType)
objectivec

音质档位

枚举值
类型值说明
ByteRTCAudioProfileDefault0默认音质

服务器下发或客户端已设置的 ByteRTCRoomProfile 的音质配置
ByteRTCAudioProfileFluent1流畅

单声道,采样率为 16 kHz,编码码率为 32 Kbps。

流畅优先、低功耗、低流量消耗,适用于大部分游戏场景,如小队语音、组队语音、国战语音等。
ByteRTCAudioProfileStandard2单声道标准音质。

采样率为 24 kHz,编码码率为 48 Kbps。

适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合教育场景和狼人杀等游戏。
ByteRTCAudioProfileHD3双声道音乐音质

采样率为 48 kHz,编码码率为 128 kbps。

超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK 等音乐场景。

游戏场景不建议使用。
ByteRTCAudioProfileStandardStereo4双声道标准音质。采样率为 48 KHz,编码码率最大值为 80 Kbps
ByteRTCAudioProfileHDMono5单声道音乐音质。采样率为 48 kHz,编码码率最大值为 64 Kbps
ByteRTCAudioDeviceType
typedef NS_ENUM(NSInteger, ByteRTCAudioDeviceType)
objectivec

当前音频设备类型

枚举值
类型值说明
ByteRTCAudioDeviceTypeUnknown-1未知音频设备
ByteRTCAudioDeviceTypeRenderDevice0音频渲染设备
ByteRTCAudioDeviceTypeCaptureDevice1音频采集设备
ByteRTCAudioDeviceTypeScreenCaptureDevice2屏幕流音频设备
ByteRTCAudioSampleRate
typedef NS_ENUM(NSInteger, ByteRTCAudioSampleRate)
objectivec

音频采样率,单位为 Hz。

枚举值
类型值说明
ByteRTCAudioSampleRateAuto-1默认设置。
ByteRTCAudioSampleRate800080008000 Hz
ByteRTCAudioSampleRate160001600016000 Hz
ByteRTCAudioSampleRate320003200032000 Hz
ByteRTCAudioSampleRate441004410044100 Hz
ByteRTCAudioSampleRate480004800048000 Hz
ByteRTCAudioChannel
typedef NS_ENUM(NSInteger, ByteRTCAudioChannel)
objectivec

音频声道。

枚举值
类型值说明
ByteRTCAudioChannelAuto-1默认设置。
ByteRTCAudioChannelMono1单声道
ByteRTCAudioChannelStereo2双声道
ByteRTCAACProfile
typedef NS_ENUM(NSInteger, ByteRTCAACProfile)
objectivec

AAC 编码类型。

枚举值
类型值说明
ByteRTCAACProfileLC0LC(默认)
ByteRTCAACProfileHEv11HEv1
ByteRTCAACProfileHEv22HEv2
ByteRTCAudioRoute
typedef NS_ENUM(NSInteger, ByteRTCAudioRoute)
objectivec

音频播放路由

枚举值
类型值说明
ByteRTCAudioRouteUnknown-1未知设备
ByteRTCAudioRouteHeadset1有线耳机
ByteRTCAudioRouteEarpiece2听筒。设备自带的,一般用于通话的播放硬件。
ByteRTCAudioRouteSpeakerphone3扬声器。设备自带的,一般用于免提播放的硬件。
ByteRTCAudioRouteHeadsetBluetooth4蓝牙耳机
ByteRTCAudioRouteHeadsetUSB5USB设备
ByteRTCAudioPlaybackDevice
typedef NS_ENUM(NSInteger, ByteRTCAudioPlaybackDevice)
objectivec

音频播放设备

音频设备变化时 SDK 通过 rtcEngine:onAudioPlaybackDeviceChanged: 回调当前音频播放设备。

枚举值
类型值说明
ByteRTCAudioPlaybackDeviceHeadset1有线耳机
ByteRTCAudioPlaybackDeviceEarpiece2听筒
ByteRTCAudioPlaybackDeviceSpeakerphone3扬声器
ByteRTCAudioPlaybackDeviceHeadsetBluetooth4蓝牙耳机
ByteRTCAudioPlaybackDeviceHeadsetUSB5USB设备
ByteRTCASRAuthorizationType
typedef NS_ENUM(NSInteger, ByteRTCASRAuthorizationType)
objectivec

语音识别服务鉴权方式,详情请咨询语音识别服务相关人员

枚举值
类型值说明
ByteRTCASRAuthorizationTypeToken0使用 token 不设置加密形式。
ByteRTCASRAuthorizationTypeSignature1带有 token 额外使用 signature 加密,此种加密形式需要额外传递 secret token 。
ByteRTCASRErrorCode
typedef NS_ENUM(NSInteger, ByteRTCASRErrorCode)
objectivec

语音识别服务错误码。

除网络原因导致的错误,语音识别服务内部会自行重试之外,其他错误都会停止服务,此时建议再次调用 startASR:handler: 重启语音识别功能。

枚举值
类型值说明
ByteRTCASRErrorNetworkInterrupted-1网络连接中断,服务不可用,内部会进行重连
ByteRTCASRErrorAlreadyStarted-2用户已经调用过 startASR:handler:。

开启语音识别服务后,你需要先调用 stopASR 停止语音识别服务,才能二次调用 startASR:handler: 再次开启服务。
ByteRTCASRErrorTokenEmpty-3语音识别服务所需 token 为空
ByteRTCErrorSignatureKeyEmpty-4Signature 鉴权模式下 secretKey 为空
ByteRTCASRErrorUserIdNull-5用户 ID 为空
ByteRTCASRErrorAPPIDNull-6应用 ID 为空
ByteRTCASRErrorClusterNull-7语音识别服务 cluster 为空
ByteRTCASRErrorOperationDenied-8语音识别服务连接失败,该版本没有语音识别功能,请联系 RTC 技术支持。
ByteRTCAudioMixingType
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingType)
objectivec

混音播放类型

枚举值
类型值说明
ByteRTCAudioMixingTypePlayout0仅本地播放
ByteRTCAudioMixingTypePublish1仅远端播放
ByteRTCAudioMixingTypePlayoutAndPublish2本地和远端同时播放
ByteRTCAudioMixingDualMonoMode
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingDualMonoMode)
objectivec

混音播放声道类型

枚举值
类型值说明
ByteRTCAudioMixingDualMonoModeAuto0和音频文件一致
ByteRTCAudioMixingDualMonoModeL1只能听到音频文件中左声道的音频
ByteRTCAudioMixingDualMonoModeR2只能听到音频文件中右声道的音频
ByteRTCAudioMixingDualMonoModeMix3能同时听到音频文件中左右声道的音频
ByteRTCAudioMixingState
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingState)
objectivec

音频混音文件播放状态。

枚举值
类型值说明
ByteRTCAudioMixingStatePreloaded0混音已加载
ByteRTCAudioMixingStatePlaying1混音正在播放
ByteRTCAudioMixingStatePaused2混音暂停
ByteRTCAudioMixingStateStopped3混音停止
ByteRTCAudioMixingStateFailed4混音播放失败
ByteRTCAudioMixingStateFinished5混音播放结束
ByteRTCAudioMixingStatePCMEnabled6准备PCM混音
ByteRTCAudioMixingStatePCMDisabled7PCM混音播放结束
ByteRTCAudioMixingError
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingError)
objectivec

混音错误码。

枚举值
类型值说明
ByteRTCAudioMixingErrorOk0正常
ByteRTCAudioMixingErrorPreloadFailed1预加载失败,找不到混音文件或者文件长度超出 20s
ByteRTCAudioMixingErrorStartFailed2混音开启失败,找不到混音文件或者混音文件打开失败
ByteRTCAudioMixingErrorIdNotFound3混音 ID 异常
ByteRTCAudioMixingErrorSetPositionFailed4设置混音文件的播放位置出错
ByteRTCAudioMixingErrorInValidVolume5音量参数不合法,仅支持设置的音量值为[0, 400]
ByteRTCAudioMixingErrorLoadConflict6播放的文件与预加载的文件不一致。请先使用 unloadAudioMixing: 卸载此前的文件。
ByteRTCAudioMixingErrorIdTypeNotMatch7不支持此混音类型。
ByteRTCAudioMixingErrorInValidPitch8设置混音文件的音调不合法
ByteRTCAudioMixingErrorInValidAudioTrack9设置混音文件的音轨不合法
ByteRTCAudioMixingErrorIsStarting10混音文件正在启动中
ByteRTCAudioMixingErrorInValidPlaybackSpeed11设置混音文件的播放速度不合法
ByteRTCAudioSourceType
typedef NS_ENUM(NSInteger, ByteRTCAudioSourceType)
objectivec

音频输入源类型

枚举值
类型值说明
ByteRTCAudioSourceTypeExternal0自定义采集音频源
ByteRTCAudioSourceTypeInternal1RTC SDK 内部采集音频源
ByteRTCAudioRenderType
typedef NS_ENUM(NSInteger, ByteRTCAudioRenderType)
objectivec

音频输出源类型

枚举值
类型值说明
ByteRTCAudioRenderTypeExternal0自定义渲染音频
ByteRTCAudioRenderTypeInternal1RTC SDK 内部渲染音频
ByteRTCAudioFrameCallbackMethod
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameCallbackMethod)
objectivec

音频回调方法

枚举值
类型值说明
ByteRTCAudioFrameCallbackRecord0本地麦克风录制的音频数据回调
ByteRTCAudioFrameCallbackPlayback1订阅的远端所有用户混音后的音频数据回调
ByteRTCAudioFrameCallbackMixed2本地麦克风录制和订阅的远端所有用户混音后的音频数据回调
ByteRTCAudioFrameCallbackRemoteUser3订阅的远端每个用户混音前的音频数据回调
ByteRTCAudioFrameMethod
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameMethod)
objectivec

返回给音频处理器的音频类型。

枚举值
类型值说明
ByteRTCAudioFrameProcessorRecord0本地采集的音频。
ByteRTCAudioFrameProcessorPlayback1远端音频流的混音音频。
ByteRTCAudioFrameProcessorRemoteUser2各个远端音频流。
ByteRTCAudioFrameProcessorScreen4屏幕共享音频。
ByteRTCAudioReportMode
typedef NS_ENUM(NSInteger, ByteRTCAudioReportMode)
objectivec

音量回调配置模式

枚举值
类型值说明
ByteRTCAudioReportModeNormal0默认始终开启音量回调。
ByteRTCAudioReportModeDisconnect1可见用户进房并停止推流后,关闭音量回调。
ByteRTCAudioReportModeReset2可见用户进房并停止推流后,开启音量回调,回调值重置为0。
ByteRTCAudioPropertiesMode
typedef NS_ENUM(NSInteger, ByteRTCAudioPropertiesMode)
objectivec

音频信息提示中是否包含本地混音音频数据。

枚举值
类型值说明
ByteRTCAudioPropertiesModeMicrohone0音频信息提示中,仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。
ByteRTCAudioPropertiesModeAudioMixing1音频信息提示中,除本地麦克风采集的音频数据和本地屏幕音频采集数据外,还包含本地混音的音频数据。
ByteRTCAudioVolumeInfo
@interface ByteRTCAudioVolumeInfo : NSObject
objectivec

音频流来源的用户 ID, 及对应的音量。

成员变量
类型名称
NSString*uid
NSUIntegerlinearVolume
NSUIntegernonlinearVolume
变量说明

uid
@property(copy, nonatomic) NSString * _Nonnull uid;
objectivec

音频流来源的用户 ID

linearVolume
@property(assign, nonatomic) NSUInteger linearVolume;
objectivec

线性音量,取值范围为:[0,255]

nonlinearVolume
@property(assign, nonatomic) NSUInteger nonlinearVolume;
objectivec

非线性音量,取值范围为:[-127,0]

ByteRTCAudioFormat
@interface ByteRTCAudioFormat : NSObject
objectivec

音频参数格式

成员变量
类型名称
ByteRTCAudioSampleRatesampleRate
ByteRTCAudioChannelchannel
变量说明

sampleRate
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec

音频采样率,详见 ByteRTCAudioSampleRate

channel
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec

音频声道,详见 ByteRTCAudioChannel

ByteRTCAudioFrame
@interface ByteRTCAudioFrame : NSObject
objectivec

PCM 音频帧

成员变量
类型名称
NSData*buffer
intsamples
ByteRTCAudioChannelchannel
ByteRTCAudioSampleRatesampleRate
变量说明

buffer
@property(strong, nonatomic) NSData * _Nonnull buffer;
objectivec

PCM 数据

samples
@property(assign, nonatomic) int samples;
objectivec

采样点个数

channel
@property(assign, nonatomic) ByteRTCAudioChannel channel;
objectivec

音频声道,参看 ByteRTCAudioChannel。
双声道的情况下,左右声道的音频帧数据以 LRLRLR 形式排布。

sampleRate
@property(assign, nonatomic) ByteRTCAudioSampleRate sampleRate;
objectivec

采样率,参看 ByteRTCAudioSampleRate。

ByteRTCASRConfig
@interface ByteRTCASRConfig : NSObject
objectivec

使用自动语音识别服务所需校验信息

成员变量
类型名称
NSString*appId
NSString*userId
NSString*accessToken
NSString*secretKey
NSString*cluster
ByteRTCASRAuthorizationTypeauthorizationType
变量说明

appId
@property(copy, nonatomic) NSString *_Nonnull appId;
objectivec

应用 ID

userId
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec

用户 ID

accessToken
@property(copy, nonatomic) NSString *_Nonnull accessToken;
objectivec

访问令牌

secretKey
@property(copy, nonatomic) NSString *_Nonnull secretKey;
objectivec

私钥。Signature 鉴权模式下不能为空,token 鉴权模式下为空。参看关于鉴权

cluster
@property(copy, nonatomic) NSString *_Nonnull cluster;
objectivec

场景信息,参看业务集群

authorizationType
@property(assign, nonatomic) ByteRTCASRAuthorizationType authorizationType;
objectivec

鉴权模式,参看 ByteRTCASRAuthorizationType

ByteRTCASREngineEventHandler
@protocol ByteRTCASREngineEventHandler<NSObject>
objectivec

语音识别服务使用状态回调

成员函数
返回名称
voidonSuccess
voidonMessage:
voidonError:withErrorMessage:
函数说明

onSuccess
- (void)onSuccess;
objectivec

语音识别服务开启成功回调

onMessage:
- (void)onMessage:(NSString *_Nonnull)message;
objectivec

语音转文字成功回调,该回调返回识别后的全量消息。

传入参数

参数名类型说明
messageNSString*识别完成后得到的文字消息

注意
若识别过程中发生了网络连接中断,则重连后回调的信息中只包含重连后识别的文字消息,不再包含上一次连接后识别的消息。

onError:withErrorMessage:
- (void)onError:(NSInteger)errorCode withErrorMessage:(NSString *_Nonnull)errorMessage;
objectivec

当语音识别服务内部发生错误事件时触发该回调。

传入参数

参数名类型说明
errorCodeNSInteger错误码
• < 0: 参数错误或 API 调用顺序错误,参看 ByteRTCASRErrorCode;
• >0: 参看 语音识别服务错误码
errorMessageNSString*错误原因说明
ByteRTCAudioMixingConfig
@interface ByteRTCAudioMixingConfig : NSObject
objectivec

混音配置

成员变量
类型名称
ByteRTCAudioMixingTypetype
NSIntegerplayCount
NSIntegerposition
NSIntegercallbackOnProgressInterval
变量说明

type
@property(assign, nonatomic) ByteRTCAudioMixingType type;
objectivec

混音播放类型,详见 ByteRTCAudioMixingType

playCount
@property(assign, nonatomic) NSInteger playCount;
objectivec

混音播放次数

position
@property(assign, nonatomic) NSInteger position;
objectivec

混音时音频文件播放进度条位置,参数为整数,单位为毫秒

callbackOnProgressInterval
@property(assign, nonatomic) NSInteger callbackOnProgressInterval;
objectivec

设置音频文件播放进度回调的时间间隔,参数为为大于 0 的 10 的倍数,单位为毫秒,设置后 SDK 将按照设置的值触发 rtcEngine:onAudioMixingPlayingProgress:progress: 回调,默认不回调。

ByteRTCAudioPropertiesConfig
@interface ByteRTCAudioPropertiesConfig : NSObject
objectivec

音频属性信息提示的相关配置。

成员变量
类型名称
NSIntegerinterval
BOOLenable_spectrum
BOOLenable_vad
ByteRTCAudioReportModelocal_main_report_mode
ByteRTCAudioPropertiesModeaudio_report_mode
变量说明

interval
@property(assign, nonatomic) NSInteger interval;
objectivec

信息提示间隔,单位:ms

enable_spectrum
@property(assign, nonatomic) BOOL enable_spectrum;
objectivec

是否开启音频频谱检测。

enable_vad
@property(assign, nonatomic) BOOL enable_vad;
objectivec

是否开启人声检测 (VAD)。

local_main_report_mode
@property(assign, nonatomic) ByteRTCAudioReportMode local_main_report_mode;
objectivec

音量回调模式。详见 ByteRTCAudioReportMode。

audio_report_mode
@property(assign, nonatomic) ByteRTCAudioPropertiesMode audio_report_mode;
objectivec

设置 rtcEngine:onLocalAudioPropertiesReport: 回调中是否包含本地混音音频数据。参看 ByteRTCAudioPropertiesMode。

默认仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。

ByteRTCAudioPropertiesInfo
@interface ByteRTCAudioPropertiesInfo : NSObject
objectivec

音频属性信息

成员变量
类型名称
NSIntegerlinearVolume
NSIntegernonlinearVolume
NSIntegervad
NSArray<NSNumber>**spectrum
变量说明

linearVolume
@property(assign, nonatomic) NSInteger linearVolume;
objectivec

线性音量,与原始音量呈线性关系,数值越大,音量越大。取值范围是:[0,255]。

nonlinearVolume
@property(assign, nonatomic) NSInteger nonlinearVolume;
objectivec

非线性音量。由原始音量的对数值转化而来,因此在中低音量时更灵敏,可以用作 Active Speaker(房间内最活跃用户)的识别。取值范围是:[-127,0],单位 dB。

vad
@property(assign, nonatomic) NSInteger vad;
objectivec

人声检测(VAD)结果

spectrum
@property(copy, nonatomic) NSArray<NSNumber*> * _Nonnull spectrum;
objectivec

频谱数组。默认长度为 257。

ByteRTCLocalAudioPropertiesInfo
@interface ByteRTCLocalAudioPropertiesInfo : NSObject
objectivec

本地音频属性信息

成员变量
类型名称
ByteRTCStreamIndexstreamIndex
ByteRTCAudioPropertiesInfo*audioPropertiesInfo
变量说明

streamIndex
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec

流属性,包括主流、屏幕流。参看 ByteRTCStreamIndex

audioPropertiesInfo
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec

音频属性信息,详见 ByteRTCAudioPropertiesInfo

ByteRTCRemoteAudioPropertiesInfo
@interface ByteRTCRemoteAudioPropertiesInfo : NSObject
objectivec

远端音频属性信息

成员变量
类型名称
ByteRTCRemoteStreamKey*streamKey
ByteRTCAudioPropertiesInfo*audioPropertiesInfo
变量说明

streamKey
@property(strong, nonatomic) ByteRTCRemoteStreamKey *_Nonnull streamKey;
objectivec

远端流信息,详见 ByteRTCRemoteStreamKey

audioPropertiesInfo
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec

音频属性信息,详见 ByteRTCAudioPropertiesInfo

Position
@interface Position : NSObject
objectivec

本地用户在房间内的位置坐标,需自行建立空间直角坐标系

成员变量
类型名称
intx
inty
intz
变量说明

x
@property(nonatomic, assign) int x;
objectivec

x 坐标

y
@property(nonatomic, assign) int y;
objectivec

y 坐标

z
@property(nonatomic, assign) int z;
objectivec

z 坐标

ByteRTCMulDimSingScoringMode
typedef NS_ENUM(NSInteger, ByteRTCMulDimSingScoringMode)
objectivec

K 歌打分维度。

枚举值
类型值说明
ByteRTCMulDimSingScoringModeNote0按照音高进行评分。
ByteRTCSingScoringRealtimeInfo
@interface ByteRTCSingScoringRealtimeInfo : NSObject
objectivec

实时评分信息。

成员变量
类型名称
intcurrentPosition
intuserPitch
intstandardPitch
intsentenceIndex
intsentenceScore
inttotalScore
intaverageScore
变量说明

currentPosition
@property(nonatomic, assign) int currentPosition;
objectivec

当前的播放进度。

userPitch
@property(nonatomic, assign) int userPitch;
objectivec

演唱者的音高。

standardPitch
@property(nonatomic, assign) int standardPitch;
objectivec

标准音高。

sentenceIndex
@property(nonatomic, assign) int sentenceIndex;
objectivec

歌词分句索引。

sentenceScore
@property(nonatomic, assign) int sentenceScore;
objectivec

上一句歌词的评分。

totalScore
@property(nonatomic, assign) int totalScore;
objectivec

当前演唱的累计分数。

averageScore
@property(nonatomic, assign) int averageScore;
objectivec

当前演唱的平均分数。

ByteRTCStandardPitchInfo
@interface ByteRTCStandardPitchInfo : NSObject
objectivec

标准音高数据组。

成员变量
类型名称
intstartTime
intduration
intpitch
变量说明

startTime
@property(nonatomic, assign) int startTime;
objectivec

开始时间,单位 ms。

duration
@property(nonatomic, assign) int duration;
objectivec

持续时间,单位 ms。

pitch
@property(nonatomic, assign) int pitch;
objectivec

音高。

ByteRTCSingScoringConfig
@interface ByteRTCSingScoringConfig : NSObject
objectivec

K 歌评分配置。

成员变量
类型名称
ByteRTCMulDimSingScoringModemode
ByteRTCAudioSampleRatesampleRate
NSString*lyricsFilepath
NSString*midiFilepath
变量说明

mode
@property(nonatomic, assign) ByteRTCMulDimSingScoringMode mode;
objectivec

打分维度,详见 ByteRTCMulDimSingScoringMode。

sampleRate
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec

音频采样率。仅支持 44100 Hz、48000 Hz。

lyricsFilepath
@property(nonatomic, copy) NSString *_Nonnull lyricsFilepath;
objectivec

歌词文件路径。打分功能仅支持 KRC 歌词文件。

midiFilepath
@property(nonatomic, copy) NSString *_Nonnull midiFilepath;
objectivec

歌曲 midi 文件路径。

ByteRTCUserOfflineReason
typedef NS_ENUM(NSUInteger, ByteRTCUserOfflineReason)
objectivec

远端用户离开房间的原因。

枚举值
类型值说明
ByteRTCUserOfflineReasonQuit0远端用户调用 leaveRoom 方法主动退出房间。
ByteRTCUserOfflineReasonDropped1远端用户因网络等原因掉线。
ByteRTCUserOfflineReasonSwitchToInvisible2远端用户切换至隐身状态。
ByteRTCUserOfflineReasonKickedByAdmin3远端用户被踢出出房间。
因调用踢出用户的 OpenAPI,远端用户被踢出房间。
ByteRTCStreamRemoveReason
typedef NS_ENUM(NSInteger, ByteRTCStreamRemoveReason)
objectivec

房间内远端流移除原因。

枚举值
类型值说明
ByteRTCStreamRemoveReasonUnpublish0远端用户停止发布流。
ByteRTCStreamRemoveReasonPublishFailed1远端用户发布流失败。
ByteRTCStreamRemoveReasonKeepLiveFailed2保活失败。
ByteRTCStreamRemoveReasonClientDisconnected3远端用户断网。
ByteRTCStreamRemoveReasonRepublish4远端用户重新发布流。
ByteRTCStreamRemoveReasonOther5其他原因。
ByteRTCRoomProfile
typedef NS_ENUM(NSInteger, ByteRTCRoomProfile)
objectivec

房间模式

根据所需场景,选择合适的房间模式,应用不同的音视频算法、视频参数和网络配置

调用 setAudioProfile 改变音频参数配置

枚举值
类型值说明
ByteRTCRoomProfileCommunication0默认场景,通用模式
ByteRTCRoomProfileGame2游戏语音模式,低功耗、低流量消耗。

低端机在此模式下运行时,进行了额外的性能优化:

+ 部分低端机型配置编码帧长 40/60

+ 部分低端机型关闭软件 3A 音频处理

增强对 iOS 其他屏幕录制进行的兼容性,避免音频录制被 RTC 打断。
ByteRTCRoomProfileCloudGame3云游戏模式。

如果你的游戏场景需要低延迟的配置,使用此设置。

此设置下,弱网抗性较差。
ByteRTCRoomProfileLowLatency4云渲染模式。超低延时配置。

如果你的应用并非游戏但又对延时要求较高时,选用此模式

该模式下,音视频通话延时会明显降低,但同时弱网抗性、通话音质等均会受到一定影响。
ByteRTCRoomProfileChat5适用于 1 vs 1 音视频通话
ByteRTCRoomProfileChatRoom6适用于 3 人及以上纯语音通话。

通话中,闭麦时为是媒体模式,上麦后切换为通话模式。
ByteRTCRoomProfileLwTogether7实现多端同步播放音视频,适用于 “一起看” 或 “一起听” 场景。

该场景中,使用 RTC 信令同步播放进度,共享的音频内容不通过 RTC 进行传输。
ByteRTCRoomProfileGameHD8适用于对音质要求较高的游戏场景,优化音频 3A 策略,只通过媒体模式播放音频
ByteRTCRoomProfileCoHost9适用于直播中主播之间连麦的业务场景。

该场景中,直播时通过 CDN,发起连麦 PK 时使用 RTC。
ByteRTCRoomProfileInteractivePodcast10适用于单主播和观众进行音视频互动的直播。通话模式,上下麦不会有模式切换,避免音量突变现象
ByteRTCRoomProfileKTV11线上 KTV 场景,音乐音质,低延迟

使用 RTC 传输伴奏音乐,混音后的歌声,适合独唱或单通合唱
ByteRTCRoomProfileChorus12适合在线实时合唱场景,高音质,超低延迟。使用本配置前请联系技术支持进行协助完成其他配置。
ByteRTCRoomProfileGameStreaming14适用于 1 vs 1 游戏串流,支持公网或局域网。
ByteRTCRoomProfileLanLiveStreaming15适用于局域网的 1 对多视频直播,最高支持 8K, 60 帧/秒, 100 Mbps 码率

需要在局域网配置私有化部署媒体服务器。
ByteRTCRoomProfileMeeting16适用于云端会议中的个人设备
ByteRTCRoomProfileMeetingRoom17适用于云端会议中的会议室终端设备,例如 Rooms,投屏盒子等。
ByteRTCRoomProfileClassroom18适用于课堂互动,房间内所有成员都可以进行音视频互动

当你的场景中需要同时互动的成员超过 10人时使用此模式
ByteRTCConnectionState
typedef NS_ENUM(NSInteger, ByteRTCConnectionState)
objectivec

SDK 与信令服务器连接状态。

枚举值
类型值说明
ByteRTCConnectionStateDisconnected1连接断开超过 12s,此时 SDK 会尝试自动重连。
ByteRTCConnectionStateConnecting2首次请求建立连接,正在连接中。
ByteRTCConnectionStateConnected3首次连接成功。
ByteRTCConnectionStateReconnecting4涵盖了以下情况:

+ 首次连接时,10秒连接不成功;

+ 连接成功后,断连 10 秒。自动重连中。
ByteRTCConnectionStateReconnected5连接断开后,重连成功。
ByteRTCConnectionStateLost6处于 ByteRTCConnectionStateDisconnected 状态超过 10 秒,且期间重连未成功。SDK 仍将继续尝试重连。
ByteRTCConnectionStateFailed7连接失败,服务端状态异常。SDK 不会自动重连,请重新进房,或联系技术支持。
ByteRTCNetworkType
typedef NS_ENUM(NSInteger, ByteRTCNetworkType)
objectivec

SDK 网络连接类型。

枚举值
类型值说明
ByteRTCNetworkTypeUnknown-1网络连接类型未知。
ByteRTCNetworkTypeDisconnected0网络连接已断开。
ByteRTCNetworkTypeLAN1网络连接类型为 LAN 。
ByteRTCNetworkTypeWIFI2网络连接类型为 Wi-Fi(包含热点)。
ByteRTCNetworkTypeMobile2G3网络连接类型为 2G 移动网络。
ByteRTCNetworkTypeMobile3G4网络连接类型为 3G 移动网络。
ByteRTCNetworkTypeMobile4G5网络连接类型为 4G 移动网络。
ByteRTCNetworkTypeMobile5G6网络连接类型为 5G 移动网络。
ByteRTCNetworkDetectionStopReason
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionStopReason)
objectivec

通话前探测的停止原因
rtcEngine:onNetworkDetectionStopped: 回调的参数类型

枚举值
类型值说明
ByteRTCNetworkDetectionStopReasonUser0用户主动停止。
ByteRTCNetworkDetectionStopReasonTimeout1探测超过三分钟。
ByteRTCNetworkDetectionStopReasonConnectionLost2探测网络连接断开。

当超过 12s 没有收到回复,SDK 将断开网络连接,并且不再尝试重连。
ByteRTCNetworkDetectionStopReasonStreaming3本地开始推拉流,停止探测。
ByteRTCNetworkDetectionStopReasonInnerErr4网络探测失败,内部异常
ByteRTCNetworkDetectionLinkType
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionLinkType)
objectivec

通话前探测链接的类型
rtcEngine:onNetworkDetectionResult:quality:rtt:lostRate:bitrate:jitter: 回调的参数类型

枚举值
类型值说明
ByteRTCNetworkDetectionLinkTypeUp0上行网络探测。
ByteRTCNetworkDetectionLinkTypeDown1下行网络探测。
ByteRTCNetworkQuality
typedef NS_ENUM(NSUInteger, ByteRTCNetworkQuality)
objectivec

媒体流网络质量。

枚举值
类型值说明
ByteRTCNetworkQualityUnknown0网络质量未知。
ByteRTCNetworkQualityExcellent1网络质量极好。
ByteRTCNetworkQualityGood2主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。
ByteRTCNetworkQualityPoor3主观感受有瑕疵但不影响沟通。
ByteRTCNetworkQualityBad4勉强能沟通但不顺畅。
ByteRTCNetworkQualityVeryBad5网络质量非常差,基本不能沟通。
ByteRTCNetworkQualityDisconnected612 s 内无应答,代表网络断开,将返回本枚举值。
你也可以通过 rtcEngine:onConnectionStateChanged: 监听 ByteRTCConnectionStateDisconnected = 1 感知网络断开。
更多网络状态信息参见 连接状态提示。
ByteRTCSubscribeState
typedef NS_ENUM(NSInteger, ByteRTCSubscribeState)
objectivec

订阅媒体流状态

枚举值
类型值说明
ByteRTCSubscribeStateSuccess0订阅/取消订阅流成功
ByteRTCSubscribeStateFailedNotInRoom1订阅/取消订阅流失败,本地用户未在房间中
ByteRTCSubscribeStateFailedStreamNotFound2订阅/取消订阅流失败,房间内未找到指定的音视频流
ByteRTCSubscribeStateFailedOverLimit3超过订阅流数上限
ByteRTCPerformanceAlarmReason
typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmReason)
objectivec

性能相关告警的原因

枚举值
类型值说明
ByteRTCPerformanceAlarmReasonBandwidthFallback0网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonBandwidthResumed1网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonFallback2如果未开启发送性能回退,收到此告警时,意味着性能不足;

如果开启了发送性能回退,收到此告警时,意味着性能不足,且已发生发送性能回退。
ByteRTCPerformanceAlarmReasonResumed3如果未开启发送性能回退,收到此告警时,意味着性能不足已恢复;

如果开启了发送性能回退,收到此告警时,意味着性能不足已恢复,且已发生发送性能回退恢复。
ByteRTCPerformanceAlarmMode
typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmMode)
objectivec

性能回退的模式

枚举值
类型值说明
ByteRTCPerformanceAlarmModeNormal0未开启发布性能回退
ByteRTCPerformanceAlarmModeSimulcast1已开启发布性能回退
ByteRTCMessageConfig
typedef NS_ENUM(NSInteger, ByteRTCMessageConfig)
objectivec

发送消息的可靠有序类型

枚举值
类型值说明
ByteRTCMessageConfigReliableOrdered0低延时可靠有序消息
ByteRTCMessageConfigUnreliableOrdered1超低延时有序消息
ByteRTCMessageConfigUnreliableUnordered2超低延时无序消息
ByteRTCUserMessageSendResult
typedef NS_ENUM(NSInteger, ByteRTCUserMessageSendResult)
objectivec

发送消息结果,成功或失败,及失败原因

枚举值
类型值说明
ByteRTCUserMessageSendResultSuccess0发送消息成功
ByteRTCUserMessageSendResultTimeout1发送超时,没有发送。
ByteRTCUserMessageSendResultBroken2通道断开,没有发送
ByteRTCUserMessageSendResultNoReceiver3找不到接收方
ByteRTCUserMessageSendResultNoRelayPath4远端用户未登录或未进房
ByteRTCUserMessageSendResultNotJoin100消息发送方没有加入房间
ByteRTCUserMessageSendResultInit101连接未完成初始化
ByteRTCUserMessageSendResultNoConnection102没有可用的数据传输通道连接
ByteRTCUserMessageSendResultExceedMaxLength103消息超过最大长度,当前为64KB
ByteRTCUserMessageSendResultEmptyUser104接收消息的单个用户 id 为空
ByteRTCUserMessageSendResultServerParamsNotSet106发送消息给业务方服务器之前没有设置参数
ByteRTCUserMessageSendResultUnknown1000失败,未知错误。
ByteRTCUserOnlineStatus
typedef NS_ENUM(NSInteger, ByteRTCUserOnlineStatus)
objectivec

用户在线状态

枚举值
类型值说明
ByteRTCUserOnlineStatusOffline0对端用户离线
对端用户已经调用 logout,或者没有调用 login:uid: 进行登录
ByteRTCUserOnlineStatusOnline1对端用户在线
对端用户调用 login:uid: 登录,并且连接状态正常
ByteRTCUserOnlineStatusUnreachable2无法获取对端用户在线状态
发生级联错误、对端用户在线状态异常时返回
ByteRTCRoomMessageSendResult
typedef NS_ENUM(NSInteger, ByteRTCRoomMessageSendResult)
objectivec

房间内广播消息发送结果

枚举值
类型值说明
ByteRTCRoomMessageSendResultSuccess200消息发送成功
ByteRTCRoomMessageSendResultNotJoin100失败,发送方未加入房间
ByteRTCRoomMessageSendResultInit101失败,连接未完成初始化。
ByteRTCRoomMessageSendResultNoConnection102失败,没有可用的连接。
ByteRTCRoomMessageSendResultExceedMaxLength103消息超过最大长度,当前为 64KB
ByteRTCRoomMessageSendResultUnknown1000失败,未知错误。
ByteRTCPublishFallbackOption
typedef NS_ENUM(NSUInteger, ByteRTCPublishFallbackOption)
objectivec

发布端音视频流回退选项

枚举值
类型值说明
ByteRTCPublishFallbackOptionDisabled0上行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。
ByteRTCPublishFallbackOptionSimulcast1上行网络不佳或设备性能不足时,发布的视频流会从大流到小流依次降级,直到与当前网络性能匹配,具体降级规则参看性能回退文档。
ByteRTCSubscribeFallbackOption
typedef NS_ENUM(NSUInteger, ByteRTCSubscribeFallbackOption)
objectivec

订阅端音视频流回退选项。

枚举值
类型值说明
ByteRTCSubscribeFallbackOptionDisabled0下行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。
ByteRTCSubscribeFallbackOptionVideoStreamLow1下行网络不佳或设备性能不足时,对视频流做降级处理,具体降级规则参看音视频流回退。
该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。
ByteRTCSubscribeFallbackOptionAudioOnly2下行网络不佳或设备性能不足时,先对视频流做回退处理。当网络状况不满足接收弱流时,则自动取消接收视频,仅接收音频。
该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。
ByteRTCRemoteUserPriority
typedef NS_ENUM(NSUInteger, ByteRTCRemoteUserPriority)
objectivec

远端用户优先级。在性能不足需要回退时,会先回退优先级低的用户的音视频流

枚举值
类型值说明
ByteRTCRemoteUserPriorityLow0用户优先级为低,默认值
ByteRTCRemoteUserPriorityMedium100用户优先级为正常
ByteRTCRemoteUserPriorityHigh200用户优先级为高
ByteRTCFallbackOrRecoverReason
typedef NS_ENUM(NSInteger, ByteRTCFallbackOrRecoverReason)
objectivec

本地用户订阅的远端流触发回退策略的原因。

枚举值
类型值说明
ByteRTCFallbackOrRecoverReasonUnknown-1其他原因,非带宽和性能原因引起的回退或恢复。默认值
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByBandwidth0由带宽不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByPerformance1由性能不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByBandwidth2由带宽恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByPerformance3由性能恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishFallbackByBandwidth4由带宽不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishFallbackByPerformance5由性能不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishRecoverByBandwidth6由带宽恢复导致的发布端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishRecoverByPerformance7由性能恢复导致的发布端音视频流恢复。
ByteRTCLocalAudioStreamState
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamState)
objectivec

本地音频流状态。

SDK 通过 onLocalAudioStateChanged 回调该状态。

枚举值
类型值说明
ByteRTCLocalAudioStreamStateStopped0本地音频默认初始状态。
麦克风停止工作时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateRecording1本地音频录制设备启动成功。
采集到音频首帧时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateEncoding2本地音频首帧编码成功。
音频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateFailed3本地音频启动失败,在以下时机回调该状态:

+ 本地录音设备启动失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorRecordFailure

+ 检测到没有录音设备权限,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorDeviceNoPermission

+ 音频编码失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamError
ByteRTCLocalAudioStreamError
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamError)
objectivec

本地音频流状态改变时的错误码。
SDK 通过 onLocalAudioStateChanged 回调该错误码。

枚举值
类型值说明
ByteRTCLocalAudioStreamErrorOk0本地音频状态正常
ByteRTCLocalAudioStreamErrorFailure1本地音频出错原因未知
ByteRTCLocalAudioStreamErrorDeviceNoPermission2没有权限启动本地音频录制设备
ByteRTCLocalAudioStreamErrorRecordFailure4本地音频录制失败,建议你检查录制设备是否正常工作
ByteRTCLocalAudioStreamErrorEncodeFailure5本地音频编码失败
ByteRTCLocalAudioStreamErrorNoRecordingDevice6没有可用的音频录制设备
ByteRTCLocalVideoStreamState
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamState)
objectivec

本地视频流状态

枚举值
类型值说明
ByteRTCLocalVideoStreamStateStopped0本地视频默认初始状态
摄像头停止工作时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateRecording1本地视频录制设备启动成功
采集到视频首帧时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateEncoding2本地视频首帧编码成功
本地视频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateFailed3本地视频启动失败, 在以下时机回调该状态:

+ 本地采集设备启动失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorCaptureFailure

+ 检测到没有摄像头权限,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorDeviceNoPermission

+ 视频编码失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorEncodeFailure
ByteRTCLocalVideoStreamError
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamError)
objectivec

本地视频状态改变时的错误码

枚举值
类型值说明
ByteRTCLocalVideoStreamErrorOk0本地视频状态正常(本地视频状态改变正常时默认返回值)
ByteRTCLocalVideoStreamErrorFailure1本地视频流发布失败
ByteRTCLocalVideoStreamErrorDeviceNoPermission2没有权限启动本地视频采集设备
ByteRTCLocalVideoStreamErrorDeviceBusy3本地视频采集设备已被占用
ByteRTCLocalVideoStreamErrorDeviceNotFound4本地视频采集设备不存在或已移除
ByteRTCLocalVideoStreamErrorCaptureFailure5本地视频采集失败,建议检查采集设备是否正常工作
ByteRTCLocalVideoStreamErrorEncodeFailure6本地视频编码失败
ByteRTCLocalVideoStreamErrorDeviceDisconnected7通话过程中本地视频采集设备被其他程序抢占,导致设备连接中断
ByteRTCRemoteAudioState
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioState)
objectivec

用户订阅的远端音频流状态。

SDK 通过 onRemoteAudioStateChanged 回调该状态。

枚举值
类型值说明
ByteRTCRemoteAudioStateStopped0远端音频流默认初始状态,在以下时机回调该状态:

+ 本地用户停止接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalMuted

+ 远端用户停止发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteMuted

+ 远端用户离开房间,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteOffline
ByteRTCRemoteAudioStateStarting1开始接收远端音频流首包。

刚收到远端音频流首包时,会触发回调 onRemoteAudioStateChanged,
对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted
ByteRTCRemoteAudioStateDecoding2远端音频流正在解码,正常播放,在以下时机回调该状态:

+ 成功解码远端音频首帧,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonNetworkRecovery

+ 本地用户恢复接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted

+ 远端用户恢复发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted
ByteRTCRemoteAudioStateFrozen3远端音频流卡顿。

网络阻塞导致丢包率大于 40% 时,会触发回调 onRemoteAudioStateChanged,
对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonNetworkCongestion
ByteRTCRemoteAudioStateChangeReason
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioStateChangeReason)
objectivec

接收远端音频流状态改变的原因。

用户可以通过 onRemoteAudioStateChanged 了解该状态。

枚举值
类型值说明
ByteRTCRemoteAudioStateChangeReasonInternal0内部原因
ByteRTCRemoteAudioStateChangeReasonNetworkCongestion1网络阻塞
ByteRTCRemoteAudioStateChangeReasonNetworkRecovery2网络恢复正常
ByteRTCRemoteAudioStateChangeReasonLocalMuted3本地用户停止接收远端音频流
ByteRTCRemoteAudioStateChangeReasonLocalUnmuted4本地用户恢复接收远端音频流
ByteRTCRemoteAudioStateChangeReasonRemoteMuted5远端用户停止发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted6远端用户恢复发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteOffline7远端用户离开房间
ByteRTCRemoteVideoState
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoState)
objectivec

远端视频流状态

枚举值
类型值说明
ByteRTCRemoteVideoStateStopped0远端视频流默认初始状态, 在以下时机回调该状态:

+ 本地用户停止接收远端视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalMuted

+ 远端用户停止发送视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteMuted

+ 远端用户离开房间,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteOffline
ByteRTCRemoteVideoStateStarting1本地用户已接收远端视频首包

收到远端视频首包时回调该状态,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted
ByteRTCRemoteVideoStateDecoding2远端视频流正在解码,正常播放, 在以下时机回调该状态:

+ 成功解码远端视频首帧,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonNetworkRecovery

+ 本地用户恢复接收远端视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted

+ 远端用户恢复发送视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted
ByteRTCRemoteVideoStateFrozen3远端视频流卡顿

网络阻塞、丢包率等原因造成视频卡顿流时会回报该状态,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonNetworkCongestion
ByteRTCRemoteVideoStateFailed4远端音频流播放失败
ByteRTCRemoteVideoStateChangeReason
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoStateChangeReason)
objectivec

远端视频流状态改变的原因

枚举值
类型值说明
ByteRTCRemoteVideoStateChangeReasonInternal0内部原因
ByteRTCRemoteVideoStateChangeReasonNetworkCongestion1网络阻塞
ByteRTCRemoteVideoStateChangeReasonNetworkRecovery2网络恢复正常
ByteRTCRemoteVideoStateChangeReasonLocalMuted3本地用户停止接收远端视频流或本地用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonLocalUnmuted4本地用户恢复接收远端视频流或本地用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteMuted5远端用户停止发送视频流或远端用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted6远端用户恢复发送视频流或远端用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteOffline7远端用户离开房间
ByteRTCMediaDeviceState
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceState)
objectivec

媒体设备状态

通过 rtcEngine:onAudioDeviceStateChanged:device_type:device_state:device_error: 或 rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error: 回调设备状态。

枚举值
类型值说明
ByteRTCMediaDeviceStateStarted1设备已开启
ByteRTCMediaDeviceStateStopped2设备已停止
ByteRTCMediaDeviceStateRuntimeError3设备运行时错误

例如,当媒体设备的预期行为是正常采集,但没有收到采集数据时,将回调该状态。
ByteRTCMediaDeviceStateAdded10设备已插入
ByteRTCMediaDeviceStateRemoved11设备被移除
ByteRTCMediaDeviceStateInterruptionBegan12系统通话,锁屏或第三方应用打断了音视频通话。将在通话结束或第三方应用结束占用后自动恢复。
ByteRTCMediaDeviceStateInterruptionEnded13音视频通话已从系统电话或第三方应用打断中恢复
ByteRTCMediaDeviceError
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceError)
objectivec

媒体设备错误类型

枚举值
类型值说明
ByteRTCMediaDeviceErrorOK0媒体设备正常
ByteRTCMediaDeviceErrorDeviceNoPermission1没有权限启动媒体设备
ByteRTCMediaDeviceErrorDeviceBusy2媒体设备已经在使用中
ByteRTCMediaDeviceErrorDeviceFailure3媒体设备错误
ByteRTCMediaDeviceErrorDeviceNotFound4未找到指定的媒体设备
ByteRTCMediaDeviceErrorDeviceDisconnected5媒体设备被移除
ByteRTCMediaDeviceErrorDeviceNoCallback6无采集数据。当媒体设备的预期行为是正常采集,但没有收到采集数据时,将收到该错误。
ByteRTCMediaDeviceErrorUNSupportFormat7设备采样率不支持
ByteRTCMediaDeviceErrorNotFindGroupId8iOS 屏幕采集没有 group Id 参数
ByteRTCMediaDeviceWarning
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceWarning)
objectivec

媒体设备警告

枚举值
类型值说明
ByteRTCMediaDeviceWarningOK0无警告
ByteRTCMediaDeviceWarningOperationDenied1非法设备操作。在使用外部设备时,调用了 SDK 内部设备 API。
ByteRTCMediaDeviceWarningCaptureSilence2采集到的数据为静音帧。
ByteRTCMediaDeviceWarningSetAudioRouteNotExists21音频设备不存在,设置音频路由失败
ByteRTCMediaDeviceWarningSetAudioRouteNotVoipMode23当前非通话模式,不支持设置音频路由
ByteRTCProblemFeedbackOption
typedef NS_OPTIONS(NSUInteger, ByteRTCProblemFeedbackOption)
objectivec

音视频质量反馈问题类型

枚举值
类型值说明
ByteRTCProblemFeedbackOptionNone0没有问题
ByteRTCProblemFeedbackOptionOtherMessage(1 << 0)其他问题
ByteRTCProblemFeedbackOptionAudioNotClear(1 << 1)声音不清晰
ByteRTCProblemFeedbackOptionVideoNotClear(1 << 2)视频不清晰
ByteRTCProblemFeedbackOptionNotSync(1 << 3)音视频不同步
ByteRTCProblemFeedbackOptionAudioLagging(1 << 4)音频卡顿
ByteRTCProblemFeedbackOptionVideoLagging(1 << 5)视频卡顿
ByteRTCProblemFeedbackOptionDisconnected(1 << 6)连接断开
ByteRTCProblemFeedbackOptionNoAudio(1 << 7)无声音
ByteRTCProblemFeedbackOptionNoVideo(1 << 8)无画面
ByteRTCProblemFeedbackOptionAudioStrength(1 << 9)声音过小
ByteRTCProblemFeedbackOptionEcho(1 << 10)回声噪音
ByteRTCFeedBackProblemTypeEarBackDelay(1 << 11)耳返延迟大
ByteRTCProblemOption
@interface ByteRTCProblemOption: NSObject
objectivec

通话质量反馈预设问题列表

成员变量
类型名称
ByteRTCProblemFeedbackOptionoption
NSString*desc
成员函数
返回名称
instancetypeinitWithOption:
变量说明

option
@property(nonatomic, assign, readonly) ByteRTCProblemFeedbackOption option;
objectivec

读取音视频质量反馈问题类型,参看 ByteRTCProblemFeedbackOption。

desc
@property(nonatomic, copy, readonly) NSString * _Nonnull desc;
objectivec

读取 ByteRTCProblemOption 类对应的文字描述

函数说明

initWithOption:
- (instancetype _Nonnull)initWithOption:(ByteRTCProblemFeedbackOption)option;
objectivec

初始化 ByteRTCProblemOption

ByteRTCFirstFrameSendState
typedef NS_ENUM(NSUInteger, ByteRTCFirstFrameSendState)
objectivec

首帧发送状态

枚举值
类型值说明
ByteRTCFirstFrameSendStateSending0发送中
ByteRTCFirstFrameSendStateSent1发送成功
ByteRTCFirstFrameSendStateEnd2发送失败
ByteRTCFirstFramePlayState
typedef NS_ENUM(NSUInteger, ByteRTCFirstFramePlayState)
objectivec

首帧播放状态

枚举值
类型值说明
ByteRTCFirstFramePlayStatePlaying0播放中
ByteRTCFirstFramePlayStatePlay1播放成功
ByteRTCFirstFramePlayStateEnd2播放失败
ByteRTCEncryptType
typedef NS_OPTIONS(NSUInteger, ByteRTCEncryptType)
objectivec

自定义加密类型

枚举值
类型值说明
ByteRTCEncryptTypeCustomize0不使用内置加密。默认值。
ByteRTCEncryptTypeAES128CBC1AES-128-CBC 加密算法
ByteRTCEncryptTypeAES256CBC2AES-256-CBC 加密算法
ByteRTCEncryptTypeAES128ECB3AES-128-ECB 加密算法
ByteRTCEncryptTypeAES256ECB4AES-256-ECB 加密算法
ByteRTCVideoCodecType
typedef NS_ENUM(NSInteger, ByteRTCVideoCodecType)
objectivec

视频编码类型

枚举值
类型值说明
ByteRTCVideoCodecTypeUnknown0未知类型
ByteRTCVideoCodecTypeH2641标准 H264 编码格式
ByteRTCVideoCodecTypeByteVC12ByteVC1 编码器
ByteRTCMuteState
typedef NS_ENUM(NSInteger, ByteRTCMuteState)
objectivec

音视频流的发送/播放状态

枚举值
类型值说明
ByteRTCMuteStateOff0发送
ByteRTCMuteStateOn1停止发送
ByteSEIStreamEventType
typedef NS_ENUM(NSInteger, ByteSEIStreamEventType)
objectivec

黑帧视频流状态

枚举值
类型值说明
ByteSEIStreamEventTypeStreamAdd0远端用户发布黑帧视频流。

纯语音通话场景下,远端用户调用 sendSEIMessage:andMessage:andRepeatCount: 发送 SEI 数据时,SDK 会自动发布一路黑帧视频流,并触发该回调。
ByteSEIStreamEventTypeStreamRemove1远端黑帧视频流移除。该回调的触发时机包括:

+ 远端用户开启摄像头采集,由语音通话切换至视频通话,黑帧视频流停止发布;

+ 远端用户调用 sendSEIMessage:andMessage:andRepeatCount: 后 1min 内未有 SEI 数据发送,黑帧视频流停止发布;

+ 远端用户调用 setVideoSourceType:WithStreamIndex: 切换至自定义视频采集时,黑帧视频流停止发布。
ByteRTCStreamIndex
typedef NS_ENUM(NSInteger, ByteRTCStreamIndex)
objectivec

流属性

枚举值
类型值说明
ByteRTCStreamIndexMain0主流。包括:

+ 由摄像头/麦克风通过内部采集机制,采集到的视频/音频;

+ 通过自定义采集,采集到的视频/音频。
ByteRTCStreamIndexScreen1屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
ByteRTCSyncInfoStreamType
typedef NS_ENUM(NSInteger, ByteRTCSyncInfoStreamType)
objectivec

媒体流信息同步的流类型

枚举值
类型值说明
ByteRTCSyncInfoStreamTypeAudio0音频流
ByteRTCForwardStreamState
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamState)
objectivec

媒体流跨房间转发状态

枚举值
类型值说明
ByteRTCForwardStreamStateIdle0空闲状态
+ 成功调用 stopForwardStreamToRooms 后,所有目标房间为空闲状态。
+ 成功调用 updateForwardStreamToRooms 减少目标房间后,本次减少的目标房间为空闲状态。
ByteRTCForwardStreamStateSuccess1开始转发
+ 调用 startForwardStreamToRooms 成功向所有房间开始转发媒体流后,返回此状态。
+ 调用 updateForwardStreamToRooms 后,成功向新增目标房间开始转发媒体流后,返回此状态。
ByteRTCForwardStreamStateFailure2转发失败,失败详情参考 ByteRTCForwardStreamError
调用 startForwardStreamToRooms 或 updateForwardStreamToRooms 后,如遇转发失败,返回此状态。
ByteRTCForwardStreamError
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamError)
objectivec

媒体流跨房间转发过程中抛出的错误码

枚举值
类型值说明
ByteRTCForwardStreamErrorOK0正常
ByteRTCForwardStreamErrorInvalidArgument1201参数异常
ByteRTCForwardStreamErrorInvalidToken1202Token 错误
ByteRTCForwardStreamErrorResponse1203服务端异常
ByteRTCForwardStreamErrorRemoteKicked1204目标房间有相同 user id 的用户加入,转发中断
ByteRTCForwardStreamErrorNotSupport1205服务端不支持转发功能
ByteRTCForwardStreamEvent
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamEvent)
objectivec

媒体流跨房间转发事件

枚举值
类型值说明
ByteRTCForwardStreamEventDisconnected0本端与服务器网络连接断开,暂停转发。
ByteRTCForwardStreamEventConnected1本端与服务器网络连接恢复,转发服务连接成功。
ByteRTCForwardStreamEventInterrupt2转发中断。转发过程中,如果相同 user_id 的用户进入目标房间,转发中断。
ByteRTCForwardStreamEventDstRoomUpdated3目标房间已更新,由 updateForwardStreamToRooms 触发。
ByteRTCForwardStreamEventUnExpectAPICall4API 调用时序错误。例如,在调用 startForwardStreamToRooms 之前调用 updateForwardStreamToRooms 。
ByteRTCRecordingState
typedef NS_ENUM(NSInteger, ByteRTCRecordingState)
objectivec

本地录制的状态

枚举值
类型值说明
RecordingStateError0录制异常
RecordingStateProcessing1录制进行中
RecordingStateSuccess2录制文件保存成功,调用 stopFileRecording: 结束录制之后才会收到该状态码。
ByteRTCRecordingErrorCode
typedef NS_ENUM(NSInteger, ByteRTCRecordingErrorCode)
objectivec

本地录制错误码

枚举值
类型值说明
RecordingErrorCodeOk0录制正常
RecordingErrorCodeNoPermission-1没有文件写权限
RecordingErrorCodeNotSupport-2当前版本 SDK 不支持本地录制功能,请联系技术支持人员
RecordingErrorCodeOther-3其他异常
ByteRTCRecordingFileType
typedef NS_ENUM(NSInteger, ByteRTCRecordingFileType)
objectivec

本地录制文件的存储格式

枚举值
类型值说明
RecordingFileTypeAAC0aac 格式文件
RecordingFileTypeMP41mp4 格式文件
ByteRTCAVSyncState
typedef NS_ENUM(NSInteger, ByteRTCAVSyncState)
objectivec

音视频同步状态

枚举值
类型值说明
AVSyncStateAVStreamSyncBegin0音视频开始同步
AVSyncStateAudioStreamRemove1音视频同步过程中音频移除,但不影响当前的同步关系
AVSyncStateVdieoStreamRemove2音视频同步过程中视频移除,但不影响当前的同步关系
ByteRTCEchoTestResult
typedef NS_ENUM(NSInteger, ByteRTCEchoTestResult)
objectivec

音视频回路测试结果

枚举值
类型值说明
EchoTestSuccess0接收到采集的音视频的回放,通话回路检测成功
EchoTestTimeout1测试超过 60s 仍未完成,已自动停止
EchoTestIntervalShort2上一次测试结束和下一次测试开始之间的时间间隔少于 5s
EchoTestAudioDeviceError3音频采集异常
EchoTestVideoDeviceError4视频采集异常
EchoTestAudioReceiveError5音频接收异常
EchoTestVideoReceiveError6视频接收异常
EchoTestInternalError7内部错误,不可恢复
ByteRTCEchoTestConfig
@interface ByteRTCEchoTestConfig : NSObject
objectivec

音视频回路测试参数

成员变量
类型名称
ByteRTCView*view
NSString*roomId
NSString*userId
NSString*token
BOOLenableAudio
BOOLenableVideo
NSIntegeraudioReportInterval
变量说明

view
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec

用于渲染接收到的视频的视图

roomId
@property(copy, nonatomic) NSString *_Nonnull roomId;
objectivec

测试用户加入的房间 ID。

userId
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec

进行音视频通话回路测试的用户 ID

token
@property(copy, nonatomic) NSString *_Nonnull token;
objectivec

对用户进房时进行鉴权验证的动态密钥,用于保证音视频通话回路测试的安全性。

enableAudio
@property(assign, nonatomic) BOOL enableAudio;
objectivec

是否检测音频。检测设备为系统默认音频设备。

enableVideo
@property(assign, nonatomic) BOOL enableVideo;
objectivec

是否检测视频。PC 端默认检测列表中第一个视频设备。

注意:
The video is published with fixed parameters: resolution 640px × 360px, frame rate 15fps.
The video is published with fixed parameters: resolution 640px × 360px, frame rate 15fps.

audioReportInterval
@property(assign, nonatomic) NSInteger audioReportInterval;
objectivec

音量信息提示间隔,单位:ms,默认为 100ms

ByteRTCUserInfo
@interface ByteRTCUserInfo : NSObject
objectivec

用户信息。

成员变量
类型名称
NSString*userId
NSString*extraInfo
变量说明

userId
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec

用户 ID。该字符串符合正则表达式:[a-zA-Z0-9_@\-]{1,128}。

extraInfo
@property(copy, nonatomic) NSString *_Nonnull extraInfo;
objectivec

用户需要透传的额外的信息,字符长度限制为 200 字节。会在 rtcEngine:onUserJoined:elapsed: 中回调给远端用户。

ByteRTCRoomStats
@interface ByteRTCRoomStats : NSObject
objectivec

房间通话统计数据,统计周期为 2s 。

用户进房成功后,SDK 会周期性地通过 onRoomStats 回调通知用户当前房间内的汇总统计信息。此数据结构即为回调给用户的参数类型。

成员变量
类型名称
NSIntegerduration
NSIntegertxBytes
NSIntegerrxBytes
NSIntegertxKbitrate
NSIntegerrxKbitrate
NSIntegertxAudioKBitrate
NSIntegerrxAudioKBitrate
NSIntegertxVideoKBitrate
NSIntegerrxVideoKBitrate
NSIntegertxScreenKBitrate
NSIntegerrxScreenKBitrate
NSIntegeruserCount
floatrxLostrate
floattxLostrate
NSIntegerrtt
NSIntegertxJitter
NSIntegerrxJitter
NSIntegertx_cellular_kbitrate
NSIntegerrx_cellular_kbitrate
变量说明

duration
@property(assign, nonatomic) NSInteger duration;
objectivec

用户进房开始通话后的总时长,单位为 s ,累计值

txBytes
@property(assign, nonatomic) NSInteger txBytes;
objectivec

本地用户的总发送字节数 (bytes),累计值

rxBytes
@property(assign, nonatomic) NSInteger rxBytes;
objectivec

本地用户的总接收字节数 (bytes),累计值

txKbitrate
@property(assign, nonatomic) NSInteger txKbitrate;
objectivec

发送码率(kbps),获取该数据时的瞬时值

rxKbitrate
@property(assign, nonatomic) NSInteger rxKbitrate;
objectivec

接收码率(kbps),获取该数据时的瞬时值

txAudioKBitrate
@property(assign, nonatomic) NSInteger txAudioKBitrate;
objectivec

本地用户的音频发送码率 (kbps),瞬时值

rxAudioKBitrate
@property(assign, nonatomic) NSInteger rxAudioKBitrate;
objectivec

本地用户的音频接收码率 (kbps),瞬时值

txVideoKBitrate
@property(assign, nonatomic) NSInteger txVideoKBitrate;
objectivec

本地用户的视频发送码率 (kbps),瞬时值

rxVideoKBitrate
@property(assign, nonatomic) NSInteger rxVideoKBitrate;
objectivec

本地用户的视频接收码率 (kbps),瞬时值

txScreenKBitrate
@property(assign, nonatomic) NSInteger txScreenKBitrate;
objectivec

屏幕接收码率,获取该数据时的瞬时值,单位为 Kbps

rxScreenKBitrate
@property(assign, nonatomic) NSInteger rxScreenKBitrate;
objectivec

屏幕发送码率,获取该数据时的瞬时值,单位为 Kbps

userCount
@property(assign, nonatomic) NSInteger userCount;
objectivec

当前房间内的可见用户人数,包括本地用户自身

rxLostrate
@property(assign, nonatomic) float rxLostrate;
objectivec

App 现在的下行丢包率

txLostrate
@property(assign, nonatomic) float txLostrate;
objectivec

App 现在的上行丢包率

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

客户端到服务端的往返时延

txJitter
@property(assign, nonatomic) NSInteger txJitter;
objectivec

系统上行网络抖动(ms)

rxJitter
@property(assign, nonatomic) NSInteger rxJitter;
objectivec

系统下行网络抖动(ms)

tx_cellular_kbitrate
@property(assign, nonatomic) NSInteger tx_cellular_kbitrate;
objectivec

蜂窝路径发送的码率 (kbps),为获取该数据时的瞬时值

rx_cellular_kbitrate
@property(assign, nonatomic) NSInteger rx_cellular_kbitrate;
objectivec

蜂窝路径接收码率 (kbps),为获取该数据时的瞬时值

ByteRTCSysStats
@interface ByteRTCSysStats : NSObject
objectivec

App 使用的 cpu 和 memory 信息

信息由 SDK 周期性(2s)地通过 reportSysStats 回调事件通知给用户。

成员变量
类型名称
unsignedcpu_cores
doublecpu_app_usage
doublecpu_total_usage
doublememory_usage
unsignedfull_memory
unsignedtotal_memory_usage
unsignedfree_memory
doublememory_ratio
doubletotal_memory_ratio
变量说明

cpu_cores
@property(assign, nonatomic) unsigned int cpu_cores;
objectivec

当前系统 cpu 核数

cpu_app_usage
@property(assign, nonatomic) double cpu_app_usage;
objectivec

当前应用的 CPU 使用率,取值范围为 [0, 1]。

cpu_total_usage
@property(assign, nonatomic) double cpu_total_usage;
objectivec

当前系统的 CPU 使用率,取值范围为 [0, 1]。

memory_usage
@property(assign, nonatomic) double memory_usage;
objectivec

当前App的内存使用(单位 MB)

full_memory
@property(assign, nonatomic) unsigned long long full_memory;
objectivec

全量内存(单位MB)

total_memory_usage
@property(assign, nonatomic) unsigned long long total_memory_usage;
objectivec

系统已使用内存(单位MB)

free_memory
@property(assign, nonatomic) unsigned long long free_memory;
objectivec

空闲可分配内存(单位MB)

memory_ratio
@property(assign, nonatomic) double memory_ratio;
objectivec

当前应用的内存使用率(单位 %)

total_memory_ratio
@property(assign, nonatomic) double total_memory_ratio;
objectivec

系统内存使用率(单位 %)

ByteRTCLocalVideoStats
@interface ByteRTCLocalVideoStats : NSObject
objectivec

本地视频流统计信息,统计周期为 2s 。

本地用户发布视频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的视频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。

成员变量
类型名称
floatsentKBitrate
NSIntegerinputFrameRate
NSIntegersentFrameRate
NSIntegerencoderOutputFrameRate
NSIntegerrendererOutputFrameRate
NSIntegerstatsInterval
floatvideoLossRate
NSIntegerrtt
NSIntegerencodedBitrate
NSIntegerencodedFrameWidth
NSIntegerencodedFrameHeight
NSIntegerencodedFrameCount
ByteRTCVideoCodecTypecodecType
BOOLisScreen
NSIntegerjitter
变量说明

sentKBitrate
@property(assign, nonatomic) float sentKBitrate;
objectivec

发送码率。此次统计周期内实际发送的分辨率最大的视频流的发送码率,单位为 Kbps

inputFrameRate
@property(assign, nonatomic) NSInteger inputFrameRate;
objectivec

采集帧率。此次统计周期内的视频采集帧率,单位为 fps 。

sentFrameRate
@property(assign, nonatomic) NSInteger sentFrameRate;
objectivec

发送帧率。此次统计周期内实际发送的分辨率最大的视频流的视频发送帧率,单位为 fps 。

encoderOutputFrameRate
@property(assign, nonatomic) NSInteger encoderOutputFrameRate;
objectivec

编码器输出帧率。当前编码器在此次统计周期内实际发送的分辨率最大的视频流的输出帧率,单位为 fps 。

rendererOutputFrameRate
@property(assign, nonatomic) NSInteger rendererOutputFrameRate;
objectivec

本地渲染帧率。此次统计周期内的本地视频渲染帧率,单位为 fps 。

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

统计间隔,单位为 ms 。
此字段用于设置回调的统计周期,默认设置为 2s 。

videoLossRate
@property(assign, nonatomic) float videoLossRate;
objectivec

视频丢包率。统计周期内的视频上行丢包率,取值范围为 [0, 1] 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

encodedBitrate
@property(assign, nonatomic) NSInteger encodedBitrate;
objectivec

视频编码码率。此次统计周期内的实际发送的分辨率最大的视频流视频编码码率,单位为 Kbps 。

encodedFrameWidth
@property(assign, nonatomic) NSInteger encodedFrameWidth;
objectivec

实际发送的分辨率最大的视频流的视频编码宽度,单位为 px 。

encodedFrameHeight
@property(assign, nonatomic) NSInteger encodedFrameHeight;
objectivec

实际发送的分辨率最大的视频流的视频编码高度,单位为 px 。

encodedFrameCount
@property(assign, nonatomic) NSInteger encodedFrameCount;
objectivec

此次统计周期内实际发送的分辨率最大的视频流的发送的视频帧总数。

codecType
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec

编码类型。参看 ByteRTCVideoCodecType 类型。

isScreen
@property(assign, nonatomic) BOOL isScreen;
objectivec

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频上行网络抖动,单位为 ms。

ByteRTCRemoteVideoStats
@interface ByteRTCRemoteVideoStats : NSObject
objectivec

远端视频流统计信息,统计周期为 2s 。

本地用户订阅远端视频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的远端视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
floatvideoLossRate
floatreceivedKBitrate
NSIntegerreceivedFrameRate
NSIntegerdecoderOutputFrameRate
NSIntegerrenderOutputFrameRate
NSIntegerstallCount
NSIntegerstallDuration
NSIntegere2eDelay
BOOLisScreen
NSIntegerstatsInterval
NSIntegerrtt
NSIntegerfrozenRate
ByteRTCVideoCodecTypecodecType
NSIntegervideoIndex
NSIntegerjitter
变量说明

width
@property(assign, nonatomic) NSInteger width;
objectivec

远端视频宽度。

height
@property(assign, nonatomic) NSInteger height;
objectivec

远端视频高度。

videoLossRate
@property(assign, nonatomic) float videoLossRate;
objectivec

远端视频丢包率。统计周期内的视频下行丢包率,取值范围为 [0, 1] 。

receivedKBitrate
@property(assign, nonatomic) float receivedKBitrate;
objectivec

接收码率。统计周期内的视频接收码率,单位为 kbps 。

receivedFrameRate
@property(assign, nonatomic) NSInteger receivedFrameRate;
objectivec

远端视频接收帧率。

decoderOutputFrameRate
@property(assign, nonatomic) NSInteger decoderOutputFrameRate;
objectivec

远端视频解码输出帧率。

renderOutputFrameRate
@property(assign, nonatomic) NSInteger renderOutputFrameRate;
objectivec

远端视频渲染输出帧率。

stallCount
@property(assign, nonatomic) NSInteger stallCount;
objectivec

远端视频卡顿次数。

stallDuration
@property(assign, nonatomic) NSInteger stallDuration;
objectivec

远端视频卡顿时长,单位为 ms 。

e2eDelay
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec

用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。

isScreen
@property(assign, nonatomic) BOOL isScreen;
objectivec

远端视频流是否是屏幕共享流。你可以知道当前数据来自主流还是屏幕流。

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

统计间隔,此次统计周期的间隔,单位为 ms 。

此字段用于设置回调的统计周期,目前设置为 2s 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

frozenRate
@property(assign, nonatomic) NSInteger frozenRate;
objectivec

远端用户在进房后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户进房发布视频流后,除停止发送视频流和禁用视频模块之外的视频时长。

codecType
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec

编码类型。参看 ByteRTCVideoCodecType 类型。

videoIndex
@property(assign, nonatomic) NSInteger videoIndex;
objectivec

SDK 订阅的远端视频流的分辨率下标。

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频下行网络抖动,单位为 ms。

ByteRTCLocalAudioStats
@interface ByteRTCLocalAudioStats : NSObject
objectivec

本地音频流统计信息,统计周期为 2s 。

本地用户发布音频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的音频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。

成员变量
类型名称
floataudioLossRate
floatsentKBitrate
NSIntegerrecordSampleRate
NSIntegerstatsInterval
NSIntegerrtt
NSIntegernumChannels
NSIntegersentSampleRate
NSIntegerjitter
变量说明

audioLossRate
@property(assign, nonatomic) float audioLossRate;
objectivec

音频丢包率。此次统计周期内的音频上行丢包率,取值范围为 [0, 1] 。

sentKBitrate
@property(assign, nonatomic) float sentKBitrate;
objectivec

发送的码率。此次统计周期内的音频发送码率,单位为 kbps 。

recordSampleRate
@property(assign, nonatomic) NSInteger recordSampleRate;
objectivec

采集采样率。此次统计周期内的音频采集采样率信息,单位为 Hz 。

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

统计间隔。此次统计周期的间隔,单位为 ms 。

此字段用于设置回调的统计周期,默认设置为 2s 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

numChannels
@property(assign, nonatomic) NSInteger numChannels;
objectivec

音频声道数。

sentSampleRate
@property(assign, nonatomic) NSInteger sentSampleRate;
objectivec

音频发送采样率。此次统计周期内的音频发送采样率信息,单位为 Hz 。

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

音频上行网络抖动,单位为 ms。

ByteRTCRemoteAudioStats
@interface ByteRTCRemoteAudioStats : NSObject
objectivec

远端音频流统计信息,统计周期为 2s 。

本地用户订阅远端音频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的音频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量
类型名称
floataudioLossRate
floatreceivedKBitrate
NSIntegerstallCount
NSIntegerstallDuration
NSIntegerplayoutSampleRate
NSIntegere2eDelay
NSIntegerstatsInterval
NSIntegerrtt
NSIntegertotal_rtt
NSIntegerquality
NSIntegerjitterBufferDelay
NSIntegernumChannels
NSIntegerreceivedSampleRate
NSIntegerfrozenRate
NSIntegerconcealedSamples
NSIntegerconcealmentEvent
NSIntegerdecSampleRate
NSIntegerdecDuration
NSIntegerjitter
变量说明

audioLossRate
@property(assign, nonatomic) float audioLossRate;
objectivec

音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。

receivedKBitrate
@property(assign, nonatomic) float receivedKBitrate;
objectivec

接收码率。统计周期内的音频接收码率,单位为 kbps 。

stallCount
@property(assign, nonatomic) NSInteger stallCount;
objectivec

音频卡顿次数。统计周期内的卡顿次数。

stallDuration
@property(assign, nonatomic) NSInteger stallDuration;
objectivec

音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。

playoutSampleRate
@property(assign, nonatomic) NSInteger playoutSampleRate;
objectivec

播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。

e2eDelay
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec

用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

统计间隔。此次统计周期的间隔,单位为 ms 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

客户端到服务端数据传输的往返时延,单位为 ms。

total_rtt
@property(assign, nonatomic) NSInteger total_rtt;
objectivec

发送端——服务端——接收端全链路数据传输往返时延。单位为 ms 。

quality
@property(assign, nonatomic) NSInteger quality;
objectivec

远端用户发送的音频流质量。值含义参考 ByteRTCNetworkQuality 。

jitterBufferDelay
@property(assign, nonatomic) NSInteger jitterBufferDelay;
objectivec

因引入 jitter buffer 机制导致的延时。单位为 ms 。

numChannels
@property(assign, nonatomic) NSInteger numChannels;
objectivec

音频声道数。

receivedSampleRate
@property(assign, nonatomic) NSInteger receivedSampleRate;
objectivec

音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。

frozenRate
@property(assign, nonatomic) NSInteger frozenRate;
objectivec

远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。音频有效时长是指远端用户进房发布音频流后,除停止发送音频流和禁用音频模块之外的音频时长。

concealedSamples
@property(assign, nonatomic) NSInteger concealedSamples;
objectivec

音频 PLC 样点总个数。

concealmentEvent
@property(assign, nonatomic) NSInteger concealmentEvent;
objectivec

音频丢包补偿(PLC) 累计次数。

decSampleRate
@property(assign, nonatomic) NSInteger decSampleRate;
objectivec

音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。

decDuration
@property(assign, nonatomic) NSInteger decDuration;
objectivec

此次订阅中,对远端音频流进行解码的累计耗时。单位为 s。

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频下行网络抖动,单位为 ms。

ByteRTCLocalStreamStats
@interface ByteRTCLocalStreamStats : NSObject
objectivec

本地音/视频流统计信息以及网络状况,统计周期为 2s 。

本地用户发布音/视频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的音/视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。

成员变量
类型名称
ByteRTCLocalAudioStats*audio_stats
ByteRTCLocalVideoStats*video_stats
BOOLis_screen
变量说明

audio_stats
@property(strong, nonatomic) ByteRTCLocalAudioStats *_Nonnull audio_stats;
objectivec

本地设备发送音频流的统计信息,详见 ByteRTCLocalAudioStats

video_stats
@property(strong, nonatomic) ByteRTCLocalVideoStats *_Nonnull video_stats;
objectivec

本地设备发送视频流的统计信息,详见 ByteRTCLocalVideoStats

is_screen
@property(nonatomic, assign) BOOL is_screen;
objectivec

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

ByteRTCRemoteStreamStats
@interface ByteRTCRemoteStreamStats : NSObject
objectivec

用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。

订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量
类型名称
NSString*uid
ByteRTCRemoteAudioStats*audio_stats
ByteRTCRemoteVideoStats*video_stats
BOOLis_screen
变量说明

uid
@property(copy, nonatomic) NSString *_Nonnull uid;
objectivec

用户 ID 。音频来源的用户 ID 。

audio_stats
@property(strong, nonatomic) ByteRTCRemoteAudioStats *_Nonnull audio_stats;
objectivec

远端音频流的统计信息,详见 ByteRTCRemoteAudioStats

video_stats
@property(strong, nonatomic) ByteRTCRemoteVideoStats *_Nonnull video_stats;
objectivec

远端视频流的统计信息,详见 ByteRTCRemoteVideoStats

is_screen
@property(nonatomic, assign) BOOL is_screen;
objectivec

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

ByteRTCUser
@interface ByteRTCUser : NSObject
objectivec

用户信息

成员变量
类型名称
NSString*userId
NSString*metaData
变量说明

userId
@property(nonatomic, copy, nullable) NSString *userId;
objectivec

用户 ID

metaData
@property(nonatomic, copy, nullable) NSString *metaData;
objectivec

元信息

ByteRTCRemoteStreamKey
@interface ByteRTCRemoteStreamKey : NSObject
objectivec

用户信息

成员变量
类型名称
NSString*userId
NSString*roomId
ByteRTCStreamIndexstreamIndex
变量说明

userId
@property(nonatomic, copy, nullable) NSString *userId;
objectivec

用户 ID

roomId
@property(nonatomic, copy, nullable) NSString *roomId;
objectivec

房间 ID

streamIndex
@property(nonatomic, assign) ByteRTCStreamIndex streamIndex;
objectivec

流属性,包括主流、屏幕流。参看 ByteRTCStreamIndex

ByteRTCRecordingConfig
@interface ByteRTCRecordingConfig : NSObject
objectivec

本地录制参数配置

成员变量
类型名称
NSString*dirPath
ByteRTCRecordingFileTyperecordingFileType
变量说明

dirPath
@property(strong, nonatomic) NSString* _Nullable dirPath;
objectivec

录制文件保存的绝对路径。你需要指定一个有读写权限的合法路径。

recordingFileType
@property(assign, nonatomic) ByteRTCRecordingFileType recordingFileType;
objectivec

录制存储文件格式,参看 ByteRTCRecordingFileType

ByteRTCRecordingProgress
@interface ByteRTCRecordingProgress : NSObject
objectivec

本地录制进度

成员变量
类型名称
unsignedduration
unsignedfileSize
变量说明

duration
@property(assign, nonatomic) unsigned long long duration;
objectivec

当前文件的累计录制时长,单位:毫秒

fileSize
@property(assign, nonatomic) unsigned long long fileSize;
objectivec

当前录制文件的大小,单位:byte

ByteRTCRecordingInfo
@interface ByteRTCRecordingInfo : NSObject
objectivec

本地录制的详细信息

成员变量
类型名称
NSString*filePath
ByteRTCVideoCodecTypecodecType
NSIntegerwidth
NSIntegerheight
变量说明

filePath
@property(strong, nonatomic) NSString* _Nullable filePath;
objectivec

录制文件的绝对路径,包含文件名和文件后缀

codecType
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec

录制文件的视频编码类型,参看 ByteRTCVideoCodecType

width
@property(nonatomic, assign) NSInteger width;
objectivec

录制视频的宽,单位:像素。纯音频录制请忽略该字段

height
@property(nonatomic, assign) NSInteger height;
objectivec

录制视频的高,单位:像素。纯音频录制请忽略该字段

ByteRTCStreamSycnInfoConfig
@interface ByteRTCStreamSycnInfoConfig : NSObject
objectivec

媒体流信息同步的相关配置

成员变量
类型名称
ByteRTCStreamIndexstreamIndex
intrepeatCount
ByteRTCSyncInfoStreamTypestreamType
变量说明

streamIndex
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec

流属性,主流或屏幕流。见 ByteRTCStreamIndex 。

repeatCount
@property(assign, nonatomic) int repeatCount;
objectivec

消息发送的重复次数,取值范围是 [0,25],建议设置为 [3,5]。

streamType
@property(assign, nonatomic) ByteRTCSyncInfoStreamType streamType;
objectivec

媒体流信息同步的流类型,见 ByteRTCSyncInfoStreamType 。

ForwardStreamConfiguration
@interface ForwardStreamConfiguration: NSObject
objectivec

媒体流跨房间转发的目标房间的相关信息

成员变量
类型名称
NSString*roomId
NSString*token
变量说明

roomId
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec

跨房间转发媒体流过程中目标房间 ID

token
@property(strong, nonatomic) NSString* _Nullable token;
objectivec

使用转发目标房间 RoomID 和 UserID 生成 Token。

测试时可使用控制台生成临时 Token,正式上线需要使用密钥 SDK 在你的服务端生成并下发 Token。

如果 Token 无效,转发失败。

ForwardStreamStateInfo
@interface ForwardStreamStateInfo: NSObject
objectivec

跨房间转发媒体流过程中的不同目标房间的状态和错误信息

成员变量
类型名称
NSString*roomId
ByteRTCForwardStreamStatestate
ByteRTCForwardStreamErrorerror
变量说明

roomId
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec

跨房间转发媒体流过程中目标房间 ID

空字符串代表所有目标房间

state
@property(assign, nonatomic) ByteRTCForwardStreamState state;
objectivec

跨房间转发媒体流过程中该目标房间的状态,参看 ByteRTCForwardStreamState

error
@property(assign, nonatomic) ByteRTCForwardStreamError error;
objectivec

跨房间转发媒体流过程中该目标房间抛出的错误码,参看 ByteRTCForwardStreamError

ForwardStreamEventInfo
@interface ForwardStreamEventInfo: NSObject
objectivec

跨房间转发媒体流过程中的不同目标房间发生的事件

成员变量
类型名称
NSString*roomId
ByteRTCForwardStreamEventevent
变量说明

roomId
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec

跨房间转发媒体流过程中的发生该事件的目标房间 ID

空字符串代表所有目标房间

event
@property(assign, nonatomic) ByteRTCForwardStreamEvent event;
objectivec

跨房间转发媒体流过程中该目标房间发生的事件,参看 ByteRTCForwardStreamEvent

ByteRTCNetworkQualityStats
@interface ByteRTCNetworkQualityStats: NSObject
objectivec

上行/下行网络质量

成员变量
类型名称
NSString*uid
doublelossRatio
intrtt
inttotalBandwidth
ByteRTCNetworkQualitytxQuality
ByteRTCNetworkQualityrxQuality
变量说明

uid
@property(strong, nonatomic) NSString* _Nonnull uid;
objectivec

用户 ID

lossRatio
@property(assign, nonatomic) double lossRatio;
objectivec

本端的上行/下行的丢包率,范围 [0.0,1.0]
当 uid 为本地用户时,代表发布流的上行丢包率。
当 uid 为远端用户时,代表接收所有订阅流的下行丢包率。

rtt
@property(assign, nonatomic) int rtt;
objectivec

当 uid 为本地用户时有效,客户端到服务端的往返延时(RTT),单位:ms

totalBandwidth
@property(assign, nonatomic) int totalBandwidth;
objectivec

本端的音视频 RTP 包 2 秒内的平均传输速率,单位:bps
当 uid 为本地用户时,代表发送速率。
当 uid 为远端用户时,代表所有订阅流的接收速率。

txQuality
@property(assign, nonatomic) ByteRTCNetworkQuality txQuality;
objectivec

上行网络质量评分,详见 ByteRTCNetworkQuality。

rxQuality
@property(assign, nonatomic) ByteRTCNetworkQuality rxQuality;
objectivec

下行网络质量评分,详见 ByteRTCNetworkQuality。

ByteRTCCloudProxyInfo
@interface ByteRTCCloudProxyInfo: NSObject
objectivec

云代理信息

成员变量
类型名称
NSString*cloudProxyIp
intcloudProxyPort
变量说明

cloudProxyIp
@property(strong, nonatomic) NSString* _Nonnull cloudProxyIp;
objectivec

云代理服务器 IP

cloudProxyPort
@property(assign, nonatomic) int cloudProxyPort;
objectivec

云代理服务器端口

AttenuationType
typedef NS_ENUM(NSInteger, AttenuationType)
objectivec

空间音频音量随距离衰减模式

枚举值
类型值说明
AttenuationTypeNone0不随距离衰减
AttenuationTypeLinear1线性衰减,音量随距离增大而线性减小
AttenuationTypeExponential2指数型衰减,音量随距离增大进行指数衰减
ReceiveRange
@interface ReceiveRange : NSObject
objectivec

本地用户能收听到、且具有衰减效果的音频接收范围

成员变量
类型名称
intmin
intmax
变量说明

min
@property(nonatomic, assign) int min;
objectivec

能够接收语音、并且具有衰减效果的最小距离值,该值须 ≥ 0,但 ≤ max。

小于该值的范围内没有范围语音效果,即收听到的音频音量相同。

max
@property(nonatomic, assign) int max;
objectivec

能够收听语音的最大距离值,该值须 > 0 且 ≥ min。

当收听者和声源距离处于 [min, max) 之间时,收听到的音量根据距离呈衰减效果。

超出该值范围的音频将无法收听到。

ByteRTCRangeAudioInfo
@interface ByteRTCRangeAudioInfo : NSObject
objectivec

范围语音流信息

成员变量
类型名称
NSString*userId
intfactor
变量说明

userId
@property(copy, nonatomic) NSString * _Nonnull userId;
objectivec

远端音频发布用户 ID

factor
@property(nonatomic, assign) int factor;
objectivec

本地用户听到该远端音频发布用户的衰减系数,范围 [0,100],数值为 0 时表示远端用户音频音量为 0。

ByteRtcScreenCapturerExtDelegate
@protocol ByteRtcScreenCapturerExtDelegate <NSObject>
objectivec

屏幕采集相关扩展协议,仅适用于 SDK 内部采集。

用户创建 extesion 后生成的 SampleHandler 需继承此协议以实现屏幕共享相关能力。

成员函数
返回名称
voidonQuitFromApp
voidonReceiveMessageFromApp:
voidonSocketDisconnect
voidonSocketConnect
voidonNotifyAppRunning
函数说明

onQuitFromApp
- (void)onQuitFromApp;
objectivec

通知 Broadcast Upload Extension 停止采集屏幕并退出。

注意
用户调用 stopScreenCapture 后,会触发该方法通知 extension 端的 SDK 停止屏幕采集。

onReceiveMessageFromApp:
- (void)onReceiveMessageFromApp:(NSData *)message;
objectivec

Socket 收到 App 侧发来的信息时,触发该回调

传入参数

参数名类型说明
messageNSData*App 侧发送的消息

onSocketDisconnect
- (void)onSocketDisconnect;
objectivec

Socket 连接断开时触发此回调

onSocketConnect
- (void)onSocketConnect;
objectivec

Socket 连接成功时触发此回调

onNotifyAppRunning
- (void)onNotifyAppRunning;
objectivec

检测到 App 正在进行音视频通话时触发此回调。

ByteRtcScreenCapturerExt
@interface ByteRtcScreenCapturerExt : NSObject
objectivec

屏幕采集相关扩展实例,仅适用于 SDK 内部采集。

用户创建 extesion 后生成的 SampleHandler 需通过此实例实现屏幕共享相关能力。

成员函数
返回名称
voidstartWithDelegate:groupId:
voidstop
voidprocessSampleBuffer:withType:
函数说明

startWithDelegate:groupId:
- (void)startWithDelegate:(NSObject<ByteRtcScreenCapturerExtDelegate> *)delegate groupId:(NSString *)groupId;
objectivec

开始屏幕采集

Extension 启动后,系统将自动调用该方法开启屏幕采集。

传入参数

参数名类型说明
delegateNSObject*回调代理,参看 ByteRtcScreenCapturerExtDelegate
groupIdNSString*App groups 中配置的 group ID

stop
- (void)stop;
objectivec

结束屏幕采集

Extension 关闭后,系统将自动调用该方法停止屏幕采集。

processSampleBuffer:withType:
- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType API_AVAILABLE(ios(10));
objectivec

推送 Extension 采集的数据

传入参数

参数名类型说明
sampleBufferCMSampleBufferRef采集到的数据
sampleBufferTypeRPSampleBufferType数据类型
Orientation
@interface Orientation : NSObject
objectivec

方向朝向信息

成员变量
类型名称
floatx
floaty
floatz
变量说明

x
@property(nonatomic, assign) float x;
objectivec

x 坐标

y
@property(nonatomic, assign) float y;
objectivec

y 坐标

z
@property(nonatomic, assign) float z;
objectivec

z 坐标

HumanOrientation
@interface HumanOrientation : NSObject
objectivec

三维朝向信息,三个向量需要两两垂直。参看 Orientation。

成员变量
类型名称
Orientation*forward
Orientation*right
Orientation*up
变量说明

forward
@property(nonatomic, strong) Orientation* _Nonnull forward;
objectivec

正前方朝向,默认值为 {1,0,0},即正前方朝向 x 轴正方向

@property(nonatomic, strong) Orientation* _Nonnull right;
objectivec

正右方朝向,默认值为 {0,1,0},即右手朝向 y 轴正方向

up
@property(nonatomic, strong) Orientation* _Nonnull up;
objectivec

正上方朝向,默认值为 {0,0,1},即头顶朝向 z 轴正方向

ByteRTCRenderMode
typedef NS_ENUM(NSUInteger, ByteRTCRenderMode)
objectivec

视频帧渲染设置

枚举值
类型值说明
ByteRTCRenderModeHidden1视窗填满优先。

视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。
ByteRTCRenderModeFit2视频帧内容全部显示优先。

视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。
ByteRTCRenderModeFill3视频帧自适应画布

视频帧非等比缩放,直至画布被填满。在此过程中,视频帧的长宽比例可能会发生变化。
ByteRTCTranscoderContentControlType
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderContentControlType)
objectivec

合流输出内容类型

枚举值
类型值说明
ByteRTCTranscoderContentControlTypeHasAudioAndVideo0输出的混流包含音频和视频
ByteRTCTranscoderContentControlTypeHasAudioOnly1输出的混流只包含音频
ByteRTCTranscoderContentControlTypeHasVideoOnly2输出的混流只包含视频
ByteRTCTranscoderLayoutRegionType
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderLayoutRegionType)
objectivec

合流布局区域类型

枚举值
类型值说明
ByteRTCTranscoderLayoutRegionTypeVideoStream0合流布局区域类型为视频。
ByteRTCTranscoderLayoutRegionTypeImage1合流布局区域类型为图片。
ByteRTCVideoStreamType
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamType)
objectivec

视频流类型
目前C++ SDK 只支持 ByteRTCVideoStreamTypeHigh 类型

枚举值
类型值说明
ByteRTCVideoStreamTypeHigh0高分辨率视频流
ByteRTCVideoStreamTypeLow1低分辨率视频
ByteRTCVideoStreamState
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamState)
objectivec

设置本地视频属性的返回状态。

枚举值
类型值说明
ByteRTCVideoStreamStateSuccess0设置本地视频属性成功
ByteRTCVideoStreamStateInvalid-2本地视频属性参数不合法
ByteRTCVideoOutputOrientationMode
typedef NS_ENUM(NSInteger, ByteRTCVideoOutputOrientationMode)
objectivec

视频输出方向模式

枚举值
类型值说明
ByteRTCVideoOutputOrientationModeAdaptative0自适应布局
ByteRTCVideoOutputOrientationModeFixedLandscape1横屏布局
ByteRTCVideoOutputOrientationModeFixedPortrait2竖屏布局
ByteRTCMirrorType
typedef NS_ENUM(NSUInteger, ByteRTCMirrorType)
objectivec

镜像类型

枚举值
类型值说明
ByteRTCMirrorTypeNone0本地预览和编码传输时均无镜像效果
ByteRTCMirrorTypeRender1本地预览时有镜像效果,编码传输时无镜像效果
ByteRTCMirrorTypeRenderAndEncoder3本地预览和编码传输时均有镜像效果
ByteRTCEffectBeautyMode
typedef NS_ENUM(NSUInteger, ByteRTCEffectBeautyMode)
objectivec

基础美颜模式

枚举值
类型值说明
ByteRTCEffectWhiteMode0美白
ByteRTCEffectSmoothMode1磨皮
ByteRTCEffectSharpenMode2锐化
ByteRTCVideoRotation
typedef NS_ENUM(NSInteger, ByteRTCVideoRotation)
objectivec

视频旋转信息,枚举类型,定义了以 90 度为间隔的四种旋转模式。

枚举值
类型值说明
ByteRTCVideoRotation00视频不做旋转
ByteRTCVideoRotation9090视频顺时针旋转 90 度
ByteRTCVideoRotation180180视频顺时针旋转 180 度
ByteRTCVideoRotation270270视频顺时针旋转 270 度
ByteRTCVideoContentType
typedef NS_ENUM(NSInteger, ByteRTCVideoContentType)
objectivec

视频内容类型

枚举值
类型值说明
ByteRTCVideoContentTypeNormalFrame0普通视频
ByteRTCVideoContentTypeBlackFrame1黑帧视频
ByteRTCVideoStreamScaleMode
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamScaleMode)
objectivec

视频帧缩放模式

枚举值
类型值说明
ByteRTCVideoStreamScaleModeAuto0自动缩放模式,默认设置为 ByteRTCVideoStreamScaleModeFitWithCropping。
ByteRTCVideoStreamScaleModeStretch1对视频帧进行缩放,直至充满和视窗分辨率一致为止。这一过程不保证等比缩放。
ByteRTCVideoStreamScaleModeFitWithCropping2视窗填满优先。

视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。
ByteRTCVideoStreamScaleModeFitWithFilling3视频帧内容全部显示优先。

视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。保持纵横比来缩放图像,填充短边
ByteRTCVideoPictureType
typedef NS_ENUM(NSInteger, ByteRTCVideoPictureType)
objectivec

编码帧类型

枚举值
类型值说明
ByteRTCVideoPictureTypeUnknown0未知类型
ByteRTCVideoPictureTypeI1I帧,关键帧,编解码不需要参考其他视频帧
ByteRTCVideoPictureTypeP2P帧,向前参考帧,编解码需要参考前一帧视频帧
ByteRTCVideoPictureTypeB3B帧,前后参考帧,编解码需要参考前后两帧视频帧
ByteRTCVideoEncoderPreference
typedef NS_ENUM(NSInteger, ByteRTCVideoEncoderPreference)
objectivec

编码策略偏好。

枚举值
类型值说明
ByteRTCVideoEncoderPreferenceDisabled0无偏好。不降低帧率和分辨率。
ByteRTCVideoEncoderPreferenceMaintainFramerate1(默认值)帧率优先。
ByteRTCVideoEncoderPreferenceMaintainQuality2分辨率优先。
ByteRTCVideoEncoderPreferenceBalance3平衡帧率与分辨率。
ByteRTCDataFrameType
typedef NS_ENUM(NSUInteger, ByteRTCDataFrameType)
objectivec

数据类型

枚举值
类型值说明
ByteRTCDataFrameTypeSei0SEI 数据
ByteRTCDataFrameTypeRoi1人脸识别数据
ByteRTCDataFrameTypeOther2其他数据帧类型
ByteRTCVideoCapturePreference
typedef NS_ENUM(NSInteger, ByteRTCVideoCapturePreference)
objectivec

视频采集模式

枚举值
类型值说明
ByteRTCVideoCapturePreferenceAuto0(默认)自动设置采集参数。
SDK在开启采集时根据服务端下发的采集配置结合编码参数设置最佳采集参数。
ByteRTCVideoCapturePreferenceMannal1手动设置采集参数,包括采集分辨率、帧率。
ByteRTCVideoCapturePreferenceAutoPerformance2采集参数与编码参数一致
ByteRTCVideoFrameType
typedef NS_ENUM(NSInteger, ByteRTCVideoFrameType)
objectivec

视频帧类型

枚举值
类型值说明
ByteRTCVideoFrameTypeRawMemory0视频帧类型:内存数据
ByteRTCVideoFrameTypePixelBuffer1视频帧类型:CVPixelBuffer
ByteRTCVideoPixelFormat
typedef NS_ENUM(NSInteger, ByteRTCVideoPixelFormat)
objectivec

视频帧格式

枚举值
类型值说明
ByteRTCVideoPixelFormatUnknown0未知格式
ByteRTCVideoPixelFormatI4201I420
ByteRTCVideoPixelFormatBGRA2BGRA
ByteRTCVideoPixelFormatNV213NV21
ByteRTCVideoPixelFormatRGBA4RGBA
ByteRTCVideoPixelFormatIMC25IMC2
ByteRTCVideoPixelFormatARGB7ARGB
ByteRTCVideoPixelFormatNV128NV12
ByteRTCVideoPixelFormatGLTexture2D10Opengl Texture2D纹理
ByteRTCVideoPixelFormatGLTextureOES11Opengl OES纹理
ByteRTCVideoPixelFormatCVPixelBuffer12CVPixelBuffer
ByteRTCVideoSinkPixelFormat
typedef NS_ENUM(NSInteger, ByteRTCVideoSinkPixelFormat)
objectivec

视频帧编码格式

枚举值
类型值说明
ByteRTCVideoSinkPixelFormatOriginal0原始视频帧格式
ByteRTCVideoSinkPixelFormatI4201YUV I420 格式
ByteRTCVideoSinkPixelFormatBGRA2BGRA 格式
ByteRTCVideoSinkPixelFormatNV128YUV NV21 格式
ByteRTCStreamMixingType
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingType)
objectivec

合流方式

枚举值
类型值说明
ByteRTCStreamMixingTypeByServer0通过服务端转推
ByteRTCStreamMixingTypeByClient1端云一体转推
ByteRTCStreamMixingEvent
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingEvent)
objectivec

转推直播事件

枚举值
类型值说明
ByteRTCStreamMixingEventStart1请求发起转推直播任务
ByteRTCStreamMixingEventStartSuccess2发起转推直播任务成功
ByteRTCStreamMixingEventStartFailed3发起转推直播任务失败
ByteRTCStreamMixingEventUpdate4请求更新转推直播任务配置
ByteRTCStreamMixingEventUpdateSuccess5成功更新转推直播任务配置
ByteRTCStreamMixingEventUpdateFailed6更新转推直播任务配置失败
ByteRTCStreamMixingEventStop7请求结束转推直播任务
ByteRTCStreamMixingEventStopSuccess8结束转推直播任务成功
ByteRTCStreamMixingEventStopFailed9结束转推直播任务失败
ByteRTCStreamMixingEventChangeMixType10更新转推直播任务配置的请求超时
ByteRTCStreamMixingEventFirstAudioFrameByClientMixer11得到客户端合流音频首帧
ByteRTCStreamMixingEventFirstVideoFrameByClientMixer12收到客户端合流视频首帧
ByteRTCStreamMixingEventUpdateTimeout13更新转推直播任务配置超时
ByteRTCStreamMixingEventStartTimeout14发起转推直播任务配置超时
ByteRTCStreamMixingEventRequestParamError15合流布局参数错误
ByteRTCStreamMixingEventMixImage16合流加图片
ByteRTCSubscribeMediaType
typedef NS_ENUM(NSInteger, ByteRTCSubscribeMediaType)
objectivec

订阅媒体的类型

枚举值
类型值说明
ByteRTCSubscribeMediaTypeNone0既不订阅音频,也不订阅视频
ByteRTCSubscribeMediaTypeAudioOnly1只订阅音频,不订阅视频
ByteRTCSubscribeMediaTypeVideoOnly2只订阅视频,不订阅音频
ByteRTCSubscribeMediaTypeAudioAndVideo3同时订阅音频和视频
ByteRTCPauseResumControlMediaType
typedef NS_ENUM(NSInteger, ByteRTCPauseResumControlMediaType)
objectivec

暂停/恢复接收远端的媒体流类型。

枚举值
类型值说明
ByteRTCControlMediaTypeAudio0只控制音频,不影响视频
ByteRtcControlMediaTypeVideo1只控制视频,不影响音频
ByteRtcControlMediaTypeAudioAndVideo2同时控制音频和视频
ByteRTCVideoSourceType
typedef NS_ENUM(NSInteger, ByteRTCVideoSourceType)
objectivec

视频输入源类型

枚举值
类型值说明
ByteRTCVideoSourceTypeExternal0自定义采集视频源
ByteRTCVideoSourceTypeInternal1内部采集视频源
ByteRTCVideoSourceTypeEncodedManualSimulcast2自定义编码视频源。

SDK 不会自动生成多路流,你需要自行生成并推送多路流
ByteRTCVideoSourceTypeEncodedAutoSimulcast3自定义编码视频源。

你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流
ByteRTCVideoDecoderConfig
typedef NS_ENUM(NSInteger, ByteRTCVideoDecoderConfig)
objectivec

视频解码方式

枚举值
类型值说明
ByteRTCVideoDecoderConfigRaw0开启 SDK 内部解码,只回调解码后的数据
ByteRTCVideoDecoderConfigEncode1开启自定义解码,只回调解码前数据
ByteRTCVideoDecoderConfigBoth2开启 SDK 内部解码,同时回调解码前和解码后的数据
ByteRTCVirtualBackgroundSourceType
typedef NS_ENUM(NSInteger, ByteRTCVirtualBackgroundSourceType)
objectivec

虚拟背景类型。

枚举值
类型值说明
ByteRTCVirtualBackgroundSourceTypeColor0使用纯色背景替换视频原有背景。
ByteRTCVirtualBackgroundSourceTypeImage1使用自定义图片替换视频原有背景。
ByteRTCCameraID
typedef NS_ENUM(NSInteger, ByteRTCCameraID)
objectivec

摄像头类型

枚举值
类型值说明
ByteRTCCameraIDFront0前置摄像头
ByteRTCCameraIDBack1后置摄像头
ByteRTCCameraIDExternal2外接摄像头
ByteRTCCameraIDInvalid3无效值
ByteRTCRecordingType
typedef NS_ENUM(NSInteger, ByteRTCRecordingType)
objectivec

本地录制的媒体类型

枚举值
类型值说明
RecordAudioOnly0只录制音频
RecordVideoOnly1只录制视频
RecordVideoAndAudio2同时录制音频和视频
ByteRTCScreenMediaType
typedef NS_ENUM(NSInteger, ByteRTCScreenMediaType)
objectivec

屏幕采集媒体类型

枚举值
类型值说明
ByteRTCScreenMediaTypeVideoOnly0只采集视频数据
ByteRTCScreenMediaTypeAudioOnly1只采集音频数据
ByteRTCScreenMediaTypeVideoAndAudio2音视频数据都采集
ByteRTCScreenCaptureSourceType
typedef NS_ENUM(NSUInteger, ByteRTCScreenCaptureSourceType)
objectivec

屏幕采集对象的类型

枚举值
类型值说明
ByteRTCScreenCaptureSourceTypeUnknown0类型未知
ByteRTCScreenCaptureSourceTypeWindow1应用程序的窗口
ByteRTCScreenCaptureSourceTypeScreen2桌面
ByteRTCMouseCursorCaptureState
typedef NS_ENUM(NSUInteger, ByteRTCMouseCursorCaptureState)
objectivec

内部采集屏幕视频流时,是否采集鼠标信息。

枚举值
类型值说明
ByteRTCMouseCursorCaptureStateOn0采集鼠标信息。
ByteRTCMouseCursorCaptureStateOff1不采集鼠标信息。
ByteRTCHighlightConfig
@interface ByteRTCHighlightConfig: NSObject
objectivec

屏幕共享时的边框高亮设置。

成员变量
类型名称
BOOLenableHighlight
uint32_tborderColor
intborderWidth
变量说明

enableHighlight
@property (assign, nonatomic) BOOL enableHighlight;
objectivec

是否显示高亮边框,默认显示。

borderColor
@property (assign, nonatomic) uint32_t borderColor;
objectivec

边框的颜色, 颜色格式为十六进制 ARGB: 0xAARRGGB。

borderWidth
@property (assign, nonatomic) int borderWidth;
objectivec

边框的宽度,单位:像素。

ByteRTCTorchState
typedef NS_ENUM(NSInteger, ByteRTCTorchState)
objectivec

相机补光灯状态

枚举值
类型值说明
ByteRTCTorchStateOff0相机补光灯关闭
ByteRTCTorchStateOn1相机补光灯打开
ByteRTCVideoDeviceType
typedef NS_ENUM(NSInteger, ByteRTCVideoDeviceType)
objectivec

当前视频设备类型

枚举值
类型值说明
ByteRTCVideoDeviceTypeUnknown-1未知视频设备
ByteRTCVideoDeviceTypeRenderDevice0视频渲染设备类型
ByteRTCVideoDeviceTypeCaptureDevice1视频采集设备类型
ByteRTCVideoDeviceTypeScreenCaptureDevice2屏幕流视频设备
ByteRTCMediaStreamType
typedef NS_OPTIONS(NSUInteger, ByteRTCMediaStreamType)
objectivec

媒体流类型

枚举值
类型值说明
ByteRTCMediaStreamTypeAudio(1 << 0)只控制音频
ByteRTCMediaStreamTypeVideo(1 << 1)只控制视频
ByteRTCMediaStreamTypeBothByteRTCMediaStreamTypeAudio | ByteRTCMediaStreamTypeVideo同时控制音频和视频
ByteRTCFrameRateRatio
typedef NS_ENUM(NSUInteger, ByteRTCFrameRateRatio)
objectivec

占发布端原始帧率的比例

枚举值
类型值说明
ByteRTCFrameRateRatioOrigin0100%
ByteRTCFrameRateRatioHalf150%
ByteRTCFrameRateRatioQuater225%
ByteRTCVideoRotationMode
typedef NS_ENUM(NSUInteger, ByteRTCVideoRotationMode)
objectivec

视频旋转模式

枚举值
类型值说明
ByteRTCVideoRotationModeFollowApp0App 方向
ByteRTCVideoRotationModeFollowGSensor1重力方向
ByteRTCRectangle
@interface ByteRTCRectangle : NSObject
objectivec

矩形区域,用于指定屏幕区域。

成员变量
类型名称
intx
inty
intwidth
intheight
变量说明

x
@property(assign, nonatomic) int x;
objectivec

矩形区域左上角的 x 坐标。

y
@property(assign, nonatomic) int y;
objectivec

矩形区域左上角的 y 坐标。

width
@property(assign, nonatomic) int width;
objectivec

矩形宽度,单位:px。

height
@property(assign, nonatomic) int height;
objectivec

矩形高度,单位:px。

ByteRTCFaceDetectionResult
@interface ByteRTCFaceDetectionResult : NSObject
objectivec

人脸检测结果

成员变量
类型名称
intdetectResult
intimageWidth
intimageHeight
NSArray<ByteRTCRectangle>**faces
变量说明

detectResult
@property(assign, nonatomic) int detectResult;
objectivec

人脸检测结果

imageWidth
@property(assign, nonatomic) int imageWidth;
objectivec

原始图片宽度(px)

imageHeight
@property(assign, nonatomic) int imageHeight;
objectivec

原始图片高度(px)

faces
@property(nonatomic, copy) NSArray<ByteRTCRectangle *> * _Nullable faces;
objectivec

识别到人脸的矩形框。数组的长度和检测到的人脸数量一致。参看 ByteRTCRectangle。

ByteRTCVideoCanvas
@interface ByteRTCVideoCanvas : NSObject
objectivec

视频帧渲染设置

成员变量
类型名称
ByteRTCView*view
ByteRTCRenderModerenderMode
NSString*roomId
NSString*uid
NSIntegerbackgroundColor
变量说明

view
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec

本地视图句柄

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

渲染模式,参看 ByteRTCRenderMode

roomId
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec

房间 ID

uid
@property(strong, nonatomic) NSString* _Nullable uid;
objectivec

用户 ID,必填。

backgroundColor
@property(assign, nonatomic) NSInteger backgroundColor;
objectivec

用于填充画布空白部分的背景颜色。取值范围是 [0x00000000, 0xFFFFFFFF],格式为 BGR。默认值是 0x00000000。其中,透明度设置无效。

ByteRTCFrameExtendedData
@interface ByteRTCFrameExtendedData : NSObject
objectivec

视频帧附加的数据,视频解码后获得的附加数据

成员变量
类型名称
ByteRTCDataFrameTypeframeType
NSData*extendedData
NSIntegerextendedDataLen
变量说明

frameType
@property(assign, nonatomic) ByteRTCDataFrameType frameType;
objectivec

数据类型,详见 ByteRTCDataFrameType。

extendedData
@property(strong, nonatomic) NSData * _Nullable extendedData;
objectivec

附加数据

extendedDataLen
@property(assign, nonatomic) NSInteger extendedDataLen;
objectivec

附加数据长度

ByteRTCVideoCaptureConfig
@interface ByteRTCVideoCaptureConfig: NSObject
objectivec

视频采集参数

成员变量
类型名称
ByteRTCVideoCapturePreferencepreference
CGSizevideoSize
NSIntegerframeRate
变量说明

preference
@property(nonatomic, assign) ByteRTCVideoCapturePreference preference;
objectivec

视频采集模式,参看 ByteRTCVideoCapturePreference

videoSize
@property(nonatomic, assign) CGSize videoSize;
objectivec

视频采集分辨率

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

视频采集帧率,单位:fps。

ByteRTCSubscribeConfig
@interface ByteRTCSubscribeConfig: NSObject
objectivec

订阅流的参数配置。用户手动订阅一路音视频流所使用的订阅配置参数。

用户关闭自动订阅功能,使用手动订阅模式时,通过调用 subscribeStream 方法订阅音视频流,调用时传入的参数即为此数据类型。

成员变量
类型名称
BOOLisScreen
BOOLsubscribeVideo
BOOLsubscribeAudio
NSIntegervideoIndex
NSIntegersvcLayer
NSIntegerwidth
NSIntegerheight
NSIntegerframerate
变量说明

isScreen
@property(nonatomic, assign) BOOL isScreen;
objectivec

是否是屏幕流。

用户通过设置此参数,订阅该远端用户发布的屏幕共享流或非屏幕共享流。 YES 为订阅屏幕共享流,NO 为订阅非屏幕共享流,默认值为 YES 。

subscribeVideo
@property(nonatomic, assign) BOOL subscribeVideo;
objectivec

是否订阅视频。

用户通过设置此参数,选择是否订阅远端流中的视频。 YES 为订阅视频,NO 为不订阅视频,默认值为 YES 。

subscribeAudio
@property(nonatomic, assign) BOOL subscribeAudio;
objectivec

是否订阅音频。

用户通过设置此参数,选择是否订阅远端流中的音频。YES 为订阅音频,NO 为不订阅音频,默认值为 YES 。

videoIndex
@property(nonatomic, assign) NSInteger videoIndex;
objectivec

订阅的视频流分辨率下标。

用户可以通过调用 SetVideoEncoderConfig: 方法发布多个不同分辨率的视频。因此订阅流时,需要指定订阅的具体分辨率。此参数即用于指定需订阅的分辨率的下标,默认值为 0 。

svcLayer
@property(nonatomic, assign) NSInteger svcLayer;
objectivec

订阅的视频流时域分层,默认值为 0。

width
@property(nonatomic, assign) NSInteger width;
objectivec

订阅的宽度信息,单位:px,默认值为 0。

height
@property(nonatomic, assign) NSInteger height;
objectivec

订阅的高度信息,单位:px, 默认值为0。

framerate
@property (nonatomic, assign) NSInteger framerate;
objectivec

期望订阅的最高帧率,单位:fps,默认值为 0,设为大于 0 的值时开始生效。

当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。

仅码流支持 SVC 分级编码特性时方可生效。

ByteRTCVideoFrame
@interface ByteRTCVideoFrame : NSObject
objectivec

待 SDK 编码的视频数据

成员变量
类型名称
intformat
ByteRTCVideoContentTypecontentType
CMTimetime
intstrideInPixels
intwidth
intheight
CVPixelBufferReftextureBuf
NSData*dataBuf
intcropLeft
intcropTop
intcropRight
intcropBottom
ByteRTCVideoRotationrotation
ByteRTCCameraIDcameraId
ByteRTCFrameExtendedData*extendedData
变量说明

format
@property(assign, nonatomic) int format;
objectivec

视频帧格式,参考 ByteRTCVideoPixelFormat

contentType
@property(assign, nonatomic) ByteRTCVideoContentType contentType;
objectivec

获取视频内容类型,参看 ByteRTCVideoContentType

time
@property(assign, nonatomic) CMTime time;
objectivec

当前帧的时间戳信息

strideInPixels
@property(assign, nonatomic) int strideInPixels;
objectivec

每一行像素占用的字节数

width
@property(assign, nonatomic) int width;
objectivec

视频帧宽度

height
@property(assign, nonatomic) int height;
objectivec

视频帧高度

textureBuf
@property(assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
objectivec

CVPixelBufferRef 类型的数据,当 format 为 kPixelFormatCVPixelBuffer 时有效

dataBuf
@property(strong, nonatomic) NSData * _Nullable dataBuf;
objectivec

视频帧内存块首地址

cropLeft
@property(assign, nonatomic) int cropLeft;
objectivec

视频帧左侧被裁剪的尺寸(像素)

cropTop
@property(assign, nonatomic) int cropTop;
objectivec

视频帧上部被裁剪的尺寸(像素)

cropRight
@property(assign, nonatomic) int cropRight;
objectivec

视频帧右侧被裁剪的尺寸(像素)

cropBottom
@property(assign, nonatomic) int cropBottom;
objectivec

视频帧底部被裁剪的尺寸(像素)

rotation
@property(assign, nonatomic) ByteRTCVideoRotation rotation;
objectivec

视频帧旋转角度:0, 90, 180, 270

cameraId
@property(assign, nonatomic) ByteRTCCameraID cameraId;
objectivec

视频帧的摄像头信息,参考 ByteRTCCameraID

extendedData
@property(strong, nonatomic) ByteRTCFrameExtendedData * _Nullable extendedData;
objectivec

视频帧附加的数据

ByteRTCEncodedVideoFrame
@interface ByteRTCEncodedVideoFrame : NSObject
objectivec

视频帧信息

成员变量
类型名称
ByteRTCVideoCodecTypecodecType
ByteRTCVideoPictureTypepictureType
SInt64timestampUs
SInt64timestampDtsUs
intwidth
intheight
ByteRTCVideoRotationrotation
NSData*data
变量说明

codecType
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec

视频编码类型。参看 ByteRTCVideoCodecType

pictureType
@property(assign, nonatomic) ByteRTCVideoPictureType pictureType;
objectivec

视频帧类型。参看 ByteRTCVideoPictureType

timestampUs
@property(assign, nonatomic) SInt64 timestampUs;
objectivec

视频采集时间戳,单位:微秒

timestampDtsUs
@property(assign, nonatomic) SInt64 timestampDtsUs;
objectivec

视频编码时间戳,单位:微秒

width
@property(assign, nonatomic) int width;
objectivec

视频帧宽,单位:px

height
@property(assign, nonatomic) int height;
objectivec

视频帧高,单位:px

rotation
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec

视频帧旋转角度。参看 ByteRTCVideoRotation

data
@property(strong, nonatomic) NSData * _Nonnull data;
objectivec

视频帧数据指针地址

ByteRTCTranscoderLayoutRegionDataParam
@interface ByteRTCTranscoderLayoutRegionDataParam : NSObject
objectivec

图片合流相关参数

成员变量
类型名称
NSIntegerimageWidth
NSIntegerimageHeight
变量说明

imageWidth
@property (assign, nonatomic) NSInteger imageWidth;
objectivec

原始图片的宽度,单位为 px。

imageHeight
@property (assign, nonatomic) NSInteger imageHeight;
objectivec

原始图片的高度,单位为 px。

ByteRTCVideoCompositingRegion
@interface ByteRTCVideoCompositingRegion : NSObject
objectivec

单个图片或视频流在合流中的布局信息。

开启转推直播功能后,在多路图片或视频流合流时,你可以设置其中一路流在合流中的预设布局信息。

成员变量
类型名称
NSString*uid
NSString*roomId
CGFloatx
CGFloaty
CGFloatwidth
CGFloatheight
NSIntegerzOrder
BOOLlocalUser
BOOLscreenStream
CGFloatalpha
ByteRTCTranscoderContentControlTypecontentControl
ByteRTCRenderModerenderMode
ByteRTCTranscoderLayoutRegionTypetype
NSData*data
ByteRTCTranscoderLayoutRegionDataParam*dataParam
变量说明

uid
@property(copy, nonatomic) NSString * _Nonnull uid;
objectivec

视频流发布用户的用户 ID 。必填。

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

图片或视频流所在房间的房间 ID。必填。

如果此图片或视频流是通过 startForwardStreamToRooms: 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。

x
@property(assign, nonatomic) CGFloat x;
objectivec

视频流对应区域左上角的横坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。

y
@property(assign, nonatomic) CGFloat y;
objectivec

视频流对应区域左上角的纵坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。

width
@property(assign, nonatomic) CGFloat width;
objectivec

视频流对应区域宽度相对整体画面的归一化比例,取值的范围为 (0.0, 1.0]。

height
@property(assign, nonatomic) CGFloat height;
objectivec

视频流对应区域高度相对整体画面的归一化比例,取值的范围为 (0.0, 1.0]。

zOrder
@property(assign, nonatomic) NSInteger zOrder;
objectivec

用户视频布局在画布中的层级。0为底层,值越大越上层,范围为[0 - 100]。

localUser
@property(assign, nonatomic) BOOL localUser;
objectivec

是否为本地用户

screenStream
@property(assign, nonatomic) BOOL screenStream;
objectivec

是否为屏幕流,默认为NO

alpha
@property(assign, nonatomic) CGFloat alpha;
objectivec

透明度,可选范围为 [0.0, 1.0],0.0 为全透明。

contentControl
@property (assign, nonatomic) ByteRTCTranscoderContentControlType contentControl;
objectivec

合流内容控制。默认值为 ByteRTCTranscoderContentControlTypeHasAudioAndVideo,参看 ByteRTCTranscoderContentControlType 。

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

视频显示模式。详见 ByteRTCRenderMode 数据类型。

type
@property (assign, nonatomic) ByteRTCTranscoderLayoutRegionType type;
objectivec

合流布局区域类型。参看 ByteRTCTranscoderLayoutRegionType。

data
@property (strong, nonatomic) NSData * _Nullable data;
objectivec

图片合流布局区域类型对应的数据。类型为图片时传入图片 RGBA 数据,当类型为视频流时传空。

dataParam
@property (strong, nonatomic) ByteRTCTranscoderLayoutRegionDataParam * _Nullable dataParam;
objectivec

合流布局区域数据的对应参数。当类型为视频流时传空,类型为图片时传入对应图片的参数,参看 ByteRTCTranscoderLayoutRegionDataParam。

ByteRTCVideoCompositingLayout
@interface ByteRTCVideoCompositingLayout : NSObject
objectivec

视频流合流整体布局信息。

开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。

成员变量
类型名称
NSString*backgroundColor
NSArray<ByteRTCVideoCompositingRegion>**regions
NSString*appData
变量说明

backgroundColor
@property(copy, nonatomic) NSString *_Nonnull backgroundColor;
objectivec

画布的背景颜色。格式为 RGB 定义下的 Hex 值,如 #FFB6C1 表示浅粉色。默认值 #000000,表示为黑色

regions
@property(copy, nonatomic) NSArray<ByteRTCVideoCompositingRegion *> * _Nonnull regions;
objectivec

用户布局信息列表。每条流的具体布局详见 ByteRTCVideoCompositingRegion 数据类型。

appData
@property(copy, nonatomic) NSString *_Nonnull appData;
objectivec

透传的 App 数据。长度不超过 4KB。

ByteRTCTranscodingVideoConfig
@interface ByteRTCTranscodingVideoConfig : NSObject
objectivec

视频转码配置参数。

成员变量
类型名称
NSString*codec
NSIntegerwidth
NSIntegerheight
NSIntegerfps
NSIntegergop
NSIntegerkBitRate
BOOLlowLatency
变量说明

codec
@property(copy, nonatomic) NSString * _Nonnull codec;
objectivec

codec 编码器。本参数不支持过程中更新。默认值为 0。

width
@property(assign, nonatomic) NSInteger width;
objectivec

合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640。

height
@property(assign, nonatomic) NSInteger height;
objectivec

合流视频高度。单位为 px,范围为 [2, 1080],必须是偶数。默认值为 480。

fps
@property(assign, nonatomic) NSInteger fps;
objectivec

合流的视频帧率。默认值为 15,取值范围是 [1, 60]。值不合法时,自动调整为默认值。

gop
@property(assign, nonatomic) NSInteger gop;
objectivec

I 帧间隔。默认值为 4,取值范围为 [1, 5],单位为秒。值不合法时,自动调整为默认值。

kBitRate
@property(assign, nonatomic) NSInteger kBitRate;
objectivec

合流视频码率。单位为 kbps,取值范围为 [1,10000],默认值为自适应。值不合法时,自动调整为默认值。

lowLatency
@property(assign, nonatomic) BOOL lowLatency;
objectivec

是否使用低延时特性。

ByteRTCTranscodingAudioConfig
@interface ByteRTCTranscodingAudioConfig : NSObject
objectivec

音频转码配置参数

成员变量
类型名称
NSString*codec
NSIntegersampleRate
NSIntegerchannels
NSIntegerkBitRate
ByteRTCAACProfileprofile
变量说明

codec
@property(copy, nonatomic) NSString * _Nonnull codec;
objectivec

音频编码格式,仅支持AAC编码格式。

sampleRate
@property(assign, nonatomic) NSInteger sampleRate;
objectivec

音频采样率,单位 Hz。可取 32000Hz、44100Hz、48000Hz,默认值为 48000Hz。

channels
@property(assign, nonatomic) NSInteger channels;
objectivec

音频声道数。可取 1、2,默认值为 2。

kBitRate
@property(assign, nonatomic) NSInteger kBitRate;
objectivec

音频码率,单位 Kbps。可取范围 [32Kbps, 192Kbps],默认值为 64Kbps。

profile
@property(assign, nonatomic) ByteRTCAACProfile profile;
objectivec

AAC 等级,参看 ByteRTCAACProfile。默认值为 0。

ByteRTCLiveTranscoding
@interface ByteRTCLiveTranscoding : NSObject
objectivec

转推直播配置参数。

成员变量
类型名称
ByteRTCStreamMixingTypeexpectedMixingType
ByteRTCVideoCompositingLayout*layout
ByteRTCTranscodingVideoConfig*video
ByteRTCTranscodingAudioConfig*audio
NSMutableDictionary*authInfo
NSString*url
NSString*roomId
NSString*userId
静态函数
返回名称
instancetypedefaultTranscoding
变量说明

expectedMixingType
@property(assign, nonatomic) ByteRTCStreamMixingType expectedMixingType;
objectivec

合流类型。本参数不支持过程中更新。详见 ByteRTCStreamMixingType 数据类型。

layout
@property(strong, nonatomic) ByteRTCVideoCompositingLayout * _Nonnull layout;
objectivec

视频流合流整体布局信息。

开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。详见 ByteRTCVideoCompositingLayout 数据类型。

video
@property(strong, nonatomic) ByteRTCTranscodingVideoConfig * _Nonnull video;
objectivec

视频转码配置参数。详见 ByteRTCTranscodingVideoConfig 数据类型。

audio
@property(strong, nonatomic) ByteRTCTranscodingAudioConfig * _Nonnull audio;
objectivec

音频转码配置参数。本参数不支持过程中更新。详见 ByteRTCTranscodingAudioConfig 数据类型。

authInfo
@property(strong, nonatomic) NSMutableDictionary *  _Nullable authInfo;
objectivec

业务透传鉴权信息

url
@property(copy, nonatomic) NSString * _Nullable url;
objectivec

推流 CDN 地址。本参数不支持过程中更新。

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

推流房间 ID,必填。本参数不支持过程中更新。

userId
@property(copy, nonatomic) NSString * _Nonnull userId;
objectivec

推流用户 ID。本参数不支持过程中更新。

函数说明

defaultTranscoding
+ (instancetype _Nonnull)defaultTranscoding;
objectivec

获取默认转推直播配置参数。

返回值
转推直播配置参数,参看 ByteRTCLiveTranscoding。

ByteRTCSubscribeVideoConfig
@interface ByteRTCSubscribeVideoConfig : NSObject
objectivec

视频订阅配置信息

成员变量
类型名称
NSIntegervideoIndex
NSIntegerpriority
变量说明

videoIndex
@property(assign, nonatomic) NSInteger videoIndex;
objectivec

订阅的视频流分辨率下标。

当远端用户通过调用 enableSimulcastMode: 方法启动发布多路不同分辨率的视频流时,本地用户需通过此参数指定希望订阅的流。

默认值为 0,即订阅第一路流。

如果不想更改之前的设置,可以输入 -1。

priority
@property(assign, nonatomic) NSInteger priority;
objectivec

远端用户优先级,参看 ByteRTCRemoteUserPriority,默认值为 0。

ByteRTCSourceWantedData
@interface ByteRTCSourceWantedData : NSObject
objectivec

性能回退相关数据

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

推荐视频输入宽

height
@property(nonatomic, assign) NSInteger height;
objectivec

推荐视频输入高

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

推荐视频输入帧率

ByteRTCRemoteStreamSwitchEvent
@interface ByteRTCRemoteStreamSwitchEvent : NSObject
objectivec

流切换信息。本地用户订阅的远端流触发回退策略时的流切换信息。

成员变量
类型名称
NSString*uid
BOOLisScreen
NSIntegerbeforeVideoIndex
NSIntegerafterVideoIndex
BOOLbeforeVideoEnabled
BOOLafterVideoEnabled
ByteRTCFallbackOrRecoverReasonreason
变量说明

uid
@property(nonatomic, copy) NSString * _Nonnull uid;
objectivec

订阅的音视频流的发布者的用户 ID。

isScreen
@property(nonatomic, assign) BOOL isScreen;
objectivec

流是否是屏幕流

beforeVideoIndex
@property(nonatomic, assign) NSInteger beforeVideoIndex;
objectivec

流切换前订阅视频流的分辨率对应的索引

afterVideoIndex
@property(nonatomic, assign) NSInteger afterVideoIndex;
objectivec

流切换后订阅视频流的分辨率对应的索引

beforeVideoEnabled
@property(nonatomic, assign) BOOL beforeVideoEnabled;
objectivec

流切换前是否有视频流

afterVideoEnabled
@property(nonatomic, assign) BOOL afterVideoEnabled;
objectivec

流切换后是否有视频流

reason
@property(nonatomic, assign) ByteRTCFallbackOrRecoverReason reason;
objectivec

流切换原因,详见 ByteRTCFallbackOrRecoverReason。

ByteRTCVideoSinkDelegate
@protocol ByteRTCVideoSinkDelegate <NSObject>
objectivec

自定义视频渲染器

成员函数
返回名称
voidrenderPixelBuffer:rotation:contentType:extendedData:
函数说明

renderPixelBuffer:rotation:contentType:extendedData:
- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer rotation:(ByteRTCVideoRotation)rotation contentType:(ByteRTCVideoContentType)contentType extendedData:(NSData * _Nullable)extendedData;
objectivec

输出视频的 PixelBuffer

传入参数

参数名类型说明
pixelBufferCVPixelBufferRef视频的 PixelBuffer
rotationByteRTCVideoRotation视频旋转角度,参看 ByteRTCVideoRotation
contentTypeByteRTCVideoContentType视频内部类型 参看 ByteRTCVideoContentType
extendedDataNSData*视频解码后获得的附加数据
ByteRTCVideoPreprocessorConfig
@interface ByteRTCVideoPreprocessorConfig : NSObject
objectivec

视频处理配置参数

成员变量
类型名称
ByteRTCVideoPixelFormatrequired_pixel_format
变量说明

required_pixel_format
@property(nonatomic, assign) ByteRTCVideoPixelFormat required_pixel_format;
objectivec

视频帧的像素格式,参看 ByteRTCVideoPixelFormat。

ByteRTCScreenCaptureParam
@interface ByteRTCScreenCaptureParam : NSObject
objectivec

屏幕采集设置参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
NSIntegerbitrate
CGRectregionRect
ByteRTCMouseCursorCaptureStatemouseCursorCaptureState
NSArray<NSNumber>**excludedWindowList
ByteRTCHighlightConfig*highlightConfig
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

屏幕采集宽度

height
@property(nonatomic, assign) NSInteger height;
objectivec

屏幕采集高度

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

屏幕采集帧率,单位 fps

bitrate
@property(nonatomic, assign) NSInteger bitrate;
objectivec

发送屏幕采集码率,单位 kbps

regionRect
@property(nonatomic, assign) CGRect regionRect;
objectivec

采集区域

mouseCursorCaptureState
@property(nonatomic, assign) ByteRTCMouseCursorCaptureState mouseCursorCaptureState;
objectivec

是否采集鼠标

excludedWindowList
@property (strong, nonatomic) NSArray<NSNumber *> * _Nullable excludedWindowList;
objectivec

屏幕过滤设置

highlightConfig
@property (strong, nonatomic) ByteRTCHighlightConfig * _Nonnull highlightConfig;
objectivec

采集区域的边框高亮设置,参看 ByteRTCHighlightConfig。

ByteRTCScreenCaptureSourceInfo
@interface ByteRTCScreenCaptureSourceInfo : NSObject
objectivec

屏幕采集对象的具体信息

成员变量
类型名称
ByteRTCScreenCaptureSourceTypesourceType
intptr_tsourceId
NSString*sourceName
变量说明

sourceType
@property (assign, nonatomic) ByteRTCScreenCaptureSourceType sourceType;
objectivec

屏幕分享时,共享对象的类型,参看 ByteRTCScreenCaptureSourceType

sourceId
@property (assign, nonatomic) intptr_t sourceId;
objectivec

屏幕分享时,共享对象的 ID。

sourceName
@property (copy, nonatomic) NSString * _Nullable sourceName;
objectivec

屏幕分享时共享对象的名称。

ByteRTCScreenParam
@interface ByteRTCScreenParam : NSObject
objectivec

屏幕采集设置参数

成员变量
类型名称
NSIntegerframeRate
NSIntegerbitrate
变量说明

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

编码帧率,单位为 fps

bitrate
@property(nonatomic, assign) NSInteger bitrate;
objectivec

编码码率,小于 0 时 SDK 会根据高宽自适应码率, 单位 kbps

ByteRTCVirtualBackgroundSource
@interface ByteRTCVirtualBackgroundSource: NSObject
objectivec

虚拟背景对象。

成员变量
类型名称
ByteRTCVirtualBackgroundSourceTypesourceType
intsourceColor
NSString*sourcePath
变量说明

sourceType
@property(nonatomic, assign) ByteRTCVirtualBackgroundSourceType sourceType;
objectivec

虚拟背景类型,详见 ByteRTCVirtualBackgroundSourceType 。

sourceColor
@property int sourceColor;
objectivec

纯色背景使用的颜色。

格式为 0xAARRGGBB 。

sourcePath
@property(nonatomic) NSString* _Nullable sourcePath;
objectivec

自定义背景图片的绝对路径。

ByteRTCVideoFrameInfo
@interface ByteRTCVideoFrameInfo : NSObject
objectivec

视频帧基础信息

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
ByteRTCVideoRotationrotation
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

视频帧的宽度(像素)

height
@property(nonatomic, assign) NSInteger height;
objectivec

视频帧的高度(像素)

rotation
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec

视频帧顺时针旋转角度。参看 ByteRTCVideoRotation。

ByteRTCVideoEncoderConfig
@interface ByteRTCVideoEncoderConfig: NSObject
objectivec

视频编码配置。参考 设置视频发布参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
NSIntegermaxBitrate
ByteRTCVideoEncoderPreferenceencoderPreference
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

视频宽度,单位:px

height
@property(nonatomic, assign) NSInteger height;
objectivec

视频高度,单位:px

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

视频帧率,单位:fps

maxBitrate
@property(nonatomic, assign) NSInteger maxBitrate;
objectivec

最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。

设为 -1 即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。

设为 0 则不对视频流进行编码发送。

344 及以上版本,内部采集时默认值为 -1,344 以前版本无默认值,需手动设置。

encoderPreference
@property(nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;
objectivec

编码策略偏好,默认为帧率优先。参看 ByteRTCVideoEncoderPreference。

ByteRTCRemoteVideoConfig
@interface ByteRTCRemoteVideoConfig : NSObject
objectivec

远端视频帧信息

成员变量
类型名称
intframerate
intwidth
intheight
变量说明

framerate
@property (nonatomic, assign) int framerate;
objectivec

期望订阅的最高帧率,单位:fps,默认值为 0 即满帧订阅,设为大于 0 的值时开始生效。

当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。

仅码流支持 SVC 分级编码特性时方可生效。

width
@property(nonatomic, assign) int  width;
objectivec

视频宽度,单位:px

height
@property(nonatomic, assign) int   height;
objectivec

视频高度,单位:px

ByteRTCRoomConfig
@interface ByteRTCRoomConfig : NSObject
objectivec

房间参数配置

成员变量
类型名称
ByteRTCRoomProfileprofile
BOOLisAutoPublish
BOOLisAutoSubscribeAudio
BOOLisAutoSubscribeVideo
ByteRTCRemoteVideoConfig*remoteVideoConfig
变量说明

profile
@property(nonatomic) ByteRTCRoomProfile profile;
objectivec

房间模式,参看 ByteRTCRoomProfile,默认为普通音视频通话模式,进房后不可更改。

isAutoPublish
@property(assign, nonatomic) BOOL isAutoPublish;
objectivec

是否自动发布音视频流,默认为自动发布。

创建和加入多房间时,只能将其中一个房间设置为自动发布。若每个房间均不做设置,则默认在第一个加入的房间内自动发布流。

若调用 setUserVisibility: 将自身可见性设为 false,无论是默认的自动发布流还是手动设置的自动发布流都不会进行发布,你需要将自身可见性设为 true 后方可发布。

isAutoSubscribeAudio
@property(assign, nonatomic) BOOL isAutoSubscribeAudio;
objectivec

是否自动订阅音频流,默认为自动订阅。

包含主流和屏幕流。

isAutoSubscribeVideo
@property(assign, nonatomic) BOOL isAutoSubscribeVideo;
objectivec

是否自动订阅视频流,默认为自动订阅。

包含主流和屏幕流。

remoteVideoConfig
@property(nonatomic, strong) ByteRTCRemoteVideoConfig * _Nonnull remoteVideoConfig;
objectivec

远端视频流参数,参看 ByteRTCRemoteVideoConfig

ByteRTCSourceCropInfo
@interface ByteRTCSourceCropInfo : NSObject
objectivec

公共流裁剪信息

成员变量
类型名称
CGFloatLocationX
CGFloatLocationY
CGFloatWidthProportion
CGFloatHeightProportion
变量说明

LocationX
@property(assign, nonatomic) CGFloat LocationX;
objectivec

裁剪后得到的视频帧左上角横坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)

LocationY
@property(assign, nonatomic) CGFloat LocationY;
objectivec

裁剪后得到的视频帧左上角纵坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)

WidthProportion
@property(assign, nonatomic) CGFloat WidthProportion;
objectivec

裁剪后得到的视频帧宽度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]

HeightProportion
@property(assign, nonatomic) CGFloat HeightProportion;
objectivec

裁剪后得到的视频帧高度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]

ByteRTCPublicStreamRegion
@interface ByteRTCPublicStreamRegion : NSObject
objectivec

合成公共流的每条流的布局信息

成员变量
类型名称
NSString*userId
NSString*roomId
NSString*alternateImage
CGFloatx
CGFloaty
CGFloatwidth
CGFloatheight
NSIntegerzOrder
CGFloatalpha
NSIntegermediaType
NSIntegerstreamType
ByteRTCRenderModerenderMode
ByteRTCSourceCropInfo*sourceCrop
变量说明

userId
@property(copy, nonatomic) NSString * _Nonnull userId;
objectivec

用户 ID。必填。

服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

房间 ID必填。

服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。

alternateImage
@property(copy, nonatomic) NSString * _Nonnull alternateImage;
objectivec

背景图片地址

x
@property(assign, nonatomic) CGFloat x;
objectivec

用户视频布局相对画布左侧的偏移量, 相对值。范围[0.0 - 1.0]

y
@property(assign, nonatomic) CGFloat y;
objectivec

用户视频布局相对画布顶端的偏移量, 相对值。范围[0.0 - 1.0]

width
@property(assign, nonatomic) CGFloat width;
objectivec

用户视频宽度相对用户原始视频宽度的比例,相对值。范围[0.0 - 1.0]

height
@property(assign, nonatomic) CGFloat height;
objectivec

用户视频高度相对用户原始视频高度的比例,相对值。范围[0.0 - 1.0]

zOrder
@property(assign, nonatomic) NSInteger zOrder;
objectivec

用户视频布局在画布中的层级,0为底层,值越大越上层。范围[0 - 100]

alpha
@property(assign, nonatomic) CGFloat alpha;
objectivec

透明度,必填。可选范围为 [0.0, 1.0]。

mediaType
@property(assign, nonatomic) NSInteger mediaType;
objectivec

推流内容控制。默认为0。

0: 输出的混流包含音视频

1: 只包含音频

2: 表示只包含视频

streamType
@property(assign, nonatomic) NSInteger streamType;
objectivec

推流媒体类型

0:普通音视频流

1: 屏幕流

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

视频显示模式。详见 ByteRTCRenderMode 数据类型。

sourceCrop
@property(strong, nonatomic) ByteRTCSourceCropInfo * _Nonnull sourceCrop;
objectivec

视频裁剪信息。 详见 ByteRTCSourceCropInfo。

ByteRTCPublicStreamLayout
@interface ByteRTCPublicStreamLayout : NSObject
objectivec

公共流的合流布局。必填

成员变量
类型名称
NSIntegerlayoutMode
NSIntegerinterpolationMode
NSString*backgroundColor
NSString*backgroundImage
NSArray<ByteRTCPublicStreamRegion>**regions
变量说明

layoutMode
@property(assign, nonatomic) NSInteger layoutMode;
objectivec

布局模式,必填。

interpolationMode
@property(assign, nonatomic) NSInteger interpolationMode;
objectivec

插帧模式。

backgroundColor
@property(copy, nonatomic) NSString *_Nonnull backgroundColor;
objectivec

画布的背景颜色。格式为 RGB 定义下的 Hex 值,如 #FFB6C1 表示浅粉色。默认值 #000000,表示为黑色

backgroundImage
@property(copy, nonatomic) NSString *_Nonnull backgroundImage;
objectivec

背景图片地址

regions
@property(copy, nonatomic) NSArray<ByteRTCPublicStreamRegion *> * _Nonnull regions;
objectivec

用户布局信息列表。每一个该类型对象为一路单独的视频流的布局信息。

ByteRTCPublicStreamVideoConfig
@interface ByteRTCPublicStreamVideoConfig : NSObject
objectivec

公共流的视频编码参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerfps
NSIntegerbitrate
变量说明

width
@property(assign, nonatomic) NSInteger width;
objectivec

公共流视频宽度,必填。单位为 px,范围为 [2, 1920],必须是偶数。

height
@property(assign, nonatomic) NSInteger height;
objectivec

公共流视频高度,必填。单位为 px,范围为 [16, 1280],必须是偶数。

fps
@property(assign, nonatomic) NSInteger fps;
objectivec

公共流视频帧率。必填

范围:[1, 60]

bitrate
@property(assign, nonatomic) NSInteger bitrate;
objectivec

视频码率,必填

范围:[1,10000000]
单位为 bps

ByteRTCVideoByteWatermark
@interface ByteRTCVideoByteWatermark: NSObject
objectivec

水印图片相对视频流的位置和大小。

成员变量
类型名称
floatx
floaty
floatwidth
floatheight
变量说明

x
@property(assign, nonatomic) float x;
objectivec

水印图片相对视频流左上角的横向偏移与视频流宽度的比值,取值范围为 [0,1)。

y
@property(assign, nonatomic) float y;
objectivec

水印图片相对视频流左上角的纵向偏移与视频流高度的比值,取值范围为 [0,1)。

width
@property(assign, nonatomic) float width;
objectivec

水印图片宽度与视频流宽度的比值,取值范围 [0,1)。

height
@property(assign, nonatomic) float height;
objectivec

水印图片高度与视频流高度的比值,取值范围为 [0,1)。

ByteRTCVideoWatermarkConfig
@interface ByteRTCVideoWatermarkConfig: NSObject
objectivec

水印参数

成员变量
类型名称
BOOLvisibleInPreview
ByteRTCVideoByteWatermark*positionInLandscapeMode
ByteRTCVideoByteWatermark*positionInPortraitMode
变量说明

visibleInPreview
@property(nonatomic, assign) BOOL visibleInPreview;
objectivec

水印是否在视频预览中可见,默认可见。

positionInLandscapeMode
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInLandscapeMode;
objectivec

横屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。

positionInPortraitMode
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInPortraitMode;
objectivec

竖屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。

ByteRTCPublicStreaming
@interface ByteRTCPublicStreaming : NSObject
objectivec

公共流参数

成员变量
类型名称
ByteRTCPublicStreamLayout*layout
ByteRTCPublicStreamVideoConfig*video
静态函数
返回名称
instancetypedefaultPublicStreaming
变量说明

layout
@property(strong, nonatomic) ByteRTCPublicStreamLayout * _Nonnull layout;
objectivec

视频流公共流整体布局参数,必填。详见 ByteRTCPublicStreamLayout

video
@property(strong, nonatomic) ByteRTCPublicStreamVideoConfig * _Nonnull video;
objectivec

公共流视频编码参数。详见 ByteRTCPublicStreamVideoConfig。

函数说明

defaultPublicStreaming
+ (instancetype _Nonnull)defaultPublicStreaming;
objectivec

获取默认的公共流转码配置属性。

返回值
包含默认配置的 ByteRTCPublicStreaming 结构体