IAudioDeviceManager
public interface bytertc.IAudioDeviceManager
csharp

音频设备管理

Defined in : IAudioDeviceManager.cs

成员函数
返回名称
IDeviceCollectionEnumerateAudioPlaybackDevices
IDeviceCollectionEnumerateAudioCaptureDevices
voidFollowSystemPlaybackDevice
voidFollowSystemCaptureDevice
intSetAudioPlaybackDevice
intSetAudioCaptureDevice
intSetAudioPlaybackDeviceVolume
intGetAudioPlaybackDeviceVolume
intSetAudioCaptureDeviceVolume
intGetAudioCaptureDeviceVolume
intSetAudioPlaybackDeviceMute
intGetAudioPlaybackDeviceMute
intSetAudioCaptureDeviceMute
intGetAudioCaptureDeviceMute
intGetAudioPlaybackDevice
intGetAudioCaptureDevice
函数说明

EnumerateAudioPlaybackDevices
IDeviceCollection bytertc.IAudioDeviceManager.EnumerateAudioPlaybackDevices();
csharp

获取当前系统内音频播放设备列表。如果后续设备有变更,你需要重新调用本接口以获得新的设备列表。

返回值
包含系统中所有音频播放设备的列表,参看 IDeviceCollection。

EnumerateAudioCaptureDevices
IDeviceCollection bytertc.IAudioDeviceManager.EnumerateAudioCaptureDevices();
csharp

获取当前系统内音频采集设备列表。如果后续设备有变更,你需要重新调用本接口以获得新的设备列表。

返回值
包含系统中所有音频采集设备的列表,参看 IDeviceCollection。

FollowSystemPlaybackDevice
void bytertc.IAudioDeviceManager.FollowSystemPlaybackDevice(
    Boolean followed)
csharp

设置音频播放路由是否跟随系统。

传入参数

参数名类型说明
followedBoolean• true: 跟随。此时,调用 SetAudioPlaybackDevice 会失败。
• false: 不跟随系统。此时,可以调用 SetAudioPlaybackDevice 进行设置。

FollowSystemCaptureDevice
void bytertc.IAudioDeviceManager.FollowSystemCaptureDevice(
    Boolean followed)
csharp

设置音频采集路由是否跟随系统。

传入参数

参数名类型说明
followedBoolean• true: 跟随。此时,调用 SetAudioCaptureDevice 会失败。
• false: 不跟随系统。此时,可以调用 SetAudioCaptureDevice 进行设置。

SetAudioPlaybackDevice
int bytertc.IAudioDeviceManager.SetAudioPlaybackDevice(
    string deviceID)
csharp

设置音频播放设备。

传入参数

参数名类型说明
deviceIDstring音频播放设备 ID,可通过 EnumerateAudioPlaybackDevices 获取。

返回值

SetAudioCaptureDevice
int bytertc.IAudioDeviceManager.SetAudioCaptureDevice(
    string deviceID)
csharp

设置音频采集设备。

传入参数

参数名类型说明
deviceIDstring音频采集设备 ID,可通过 EnumerateAudioCaptureDevices 获取。

返回值

SetAudioPlaybackDeviceVolume
int bytertc.IAudioDeviceManager.SetAudioPlaybackDeviceVolume(
    uint volume)
csharp

设置当前音频播放设备音量

传入参数

参数名类型说明
volumeuint音频播放设备音量,取值范围为 [0,255], 超出此范围设置无效。
• [0,25] 接近无声;
• [25,75] 为低音量;
• [76,204] 为中音量;
• [205,255] 为高音量。

返回值

GetAudioPlaybackDeviceVolume
int bytertc.IAudioDeviceManager.GetAudioPlaybackDeviceVolume(
    ref uint volume)
csharp

获取当前音频播放设备音量

传入参数

参数名类型说明
volumeref uint音频播放设备音量,范围应在 [0,255] 内。
• [0,25] 接近无声;
• [25,75] 为低音量;
• [76,204] 为中音量;
• [205,255] 为高音量。

返回值

SetAudioCaptureDeviceVolume
int bytertc.IAudioDeviceManager.SetAudioCaptureDeviceVolume(
    uint volume)
csharp

设置当前音频采集设备音量

传入参数

参数名类型说明
volumeuint音频采集设备音量,取值范围为 [0,255], 超出此范围设置无效。
• [0,25] 接近无声;
• [25,75] 为低音量;
• [76,204] 为中音量;
• [205,255] 为高音量。

返回值

GetAudioCaptureDeviceVolume
int bytertc.IAudioDeviceManager.GetAudioCaptureDeviceVolume(
    ref uint volume)
csharp

获取当前音频采集设备音量

传入参数

参数名类型说明
volumeref uint音频采集设备音量,范围应在 [0,255] 内。
• [0,25] 接近无声;
• [25,75] 为低音量;
• [76,204] 为中音量;
• [205,255] 为高音量。

返回值

SetAudioPlaybackDeviceMute
int bytertc.IAudioDeviceManager.SetAudioPlaybackDeviceMute(
    bool mute)
csharp

设置当前音频播放设备静音状态,默认为非静音。

传入参数

参数名类型说明
mutebool• true:静音
• false:非静音

返回值

GetAudioPlaybackDeviceMute
int bytertc.IAudioDeviceManager.GetAudioPlaybackDeviceMute(
    ref bool mute)
csharp

获取当前音频播放设备是否静音的信息。

传入参数

参数名类型说明
muteref bool• true:静音
• false:非静音

返回值

SetAudioCaptureDeviceMute
int bytertc.IAudioDeviceManager.SetAudioCaptureDeviceMute(
    bool mute)
csharp

设置当前音频采集设备静音状态,默认为非静音。

传入参数

参数名类型说明
mutebool• true:静音
• false:非静音

返回值

GetAudioCaptureDeviceMute
int bytertc.IAudioDeviceManager.GetAudioCaptureDeviceMute(
    ref bool mute)
csharp

获取当前音频采集设备是否静音的信息。

传入参数

参数名类型说明
muteref bool• true:静音
• false:非静音

返回值

GetAudioPlaybackDevice
int bytertc.IAudioDeviceManager.GetAudioPlaybackDevice(
    ref string deviceID)
csharp

获取当前音频播放设备 ID。

传入参数

参数名类型说明
deviceIDref string音频播放设备 ID

返回值

GetAudioCaptureDevice
int bytertc.IAudioDeviceManager.GetAudioCaptureDevice(
    ref string deviceID)
csharp

获取当前音频采集设备 ID。

传入参数

参数名类型说明
deviceIDref string音频采集设备 ID,使用方负责按 MAX_DEVICE_ID_LENGTH 大小,分配与释放内存

返回值

IDeviceCollection
public interface bytertc.IDeviceCollection
csharp

音视频设备相关的信息

Defined in : IDeviceCollection.cs

成员函数
返回名称
intGetCount
intGetDevice
voidRelease
函数说明

GetCount
int bytertc.IDeviceCollection.GetCount();
csharp

获取当前系统内音视频设备数量

返回值
音视频设备数量

GetDevice
int bytertc.IDeviceCollection.GetDevice(
    int index,
    ref string deviceName,
    ref string deviceID)
csharp

根据索引号,获取设备信息

传入参数

参数名类型说明
indexint设备索引号,从 0 开始,注意需小于 GetCount 返回值。
deviceNameref string设备名称
deviceIDref string设备 ID

返回值

Release
void bytertc.IDeviceCollection.Release();
csharp

释放当前 IDeviceCollection 对象占用的资源。

注意
不需要返回音视频设备相关信息列表时应该调用本方法释放相关资源。

IRangeAudio
public interface bytertc.IRangeAudio
csharp

范围语音接口。

Defined in : IRangeAudio.cs

成员函数
返回名称
voidEnableRangeAudio
intUpdateReceiveRange
intUpdatePosition
intSetAttenuationModel
voidSetNoAttenuationFlags
voidRelease
函数说明

EnableRangeAudio
void bytertc.IRangeAudio.EnableRangeAudio(
    bool enable)
csharp

开启/关闭范围语音功能。

范围语音是指,在同一 RTC 房间中设定的音频接收距离范围内,本地用户收听到的远端用户音频音量会随着远端用户的靠近/远离而放大/衰减;若远端用户在房间内的位置超出设定范围,则本地用户无法接收其音频。音频接收范围设置参看 UpdateReceiveRange。

传入参数

参数名类型说明
enablebool是否开启范围语音功能:
• true: 开启
• false: 关闭(默认)

注意
该方法进房前后都可调用,为保证进房后范围语音效果的平滑切换,你需在该方法前先调用 UpdateReceiveRange 设置自身位置坐标,然后开启该方法收听范围语音效果。

UpdateReceiveRange
int bytertc.IRangeAudio.UpdateReceiveRange(
    ReceiveRange range)
csharp

更新本地用户的音频收听范围。

传入参数

参数名类型说明
rangeReceiveRange音频收听范围,参看 ReceiveRange。

返回值
方法调用结果:

UpdatePosition
int bytertc.IRangeAudio.UpdatePosition(
    Position pos)
csharp

更新本地用户在房间内空间直角坐标系中的位置坐标。

传入参数

参数名类型说明
posPosition三维坐标的值,默认为 [0, 0, 0],参看 Position。

返回值

注意
调用该接口更新坐标后,你需调用 EnableRangeAudio 开启范围语音功能以收听范围语音效果。

SetAttenuationModel
int bytertc.IRangeAudio.SetAttenuationModel(
    AttenuationType type,
    float coefficient)
csharp

设置范围语音的音量衰减模式。

传入参数

参数名类型说明
typeAttenuationType音量衰减模式。默认为线性衰减。详见 AttenuationType。
coefficientfloat指数衰减模式下的音量衰减系数,默认值为 1。范围 [0.1,100],推荐设置为 50。数值越大,音量的衰减速度越快。

返回值
调用是否成功

注意
音量衰减范围通过 UpdateReceiveRange 进行设置。

SetNoAttenuationFlags
void bytertc.IRangeAudio.SetNoAttenuationFlags(
    string[] flags,
    int len)
csharp

添加标签组,用于标记相互之间通话不衰减的用户组。

在同一个 RTC 房间中,如果多个用户的标签组之间有交集,那么,他们之间互相通话时,通话不衰减。

比如,用户身处多个队伍,队伍成员间通话不衰减。那么,可以为每个队伍绑定专属标签,每个用户的标签组包含用户所属各个队伍的标签。

传入参数

参数名类型说明
flagsstring[]标签组

Release
void bytertc.IRangeAudio.Release();
csharp

释放当前 IRangeAudio 对象占用的资源。

IRTCVideo
public interface bytertc.IRTCVideo
csharp

引擎接口

Defined in : IRTCVideo.cs

成员函数
返回名称
intCreateRTCVideo
voidRelease
stringGetErrorDescription
stringGetSDKVersion
intSetBusinessId
intFeedback
voidSetRuntimeParameters
IRTCVideoRoomCreateRTCRoom
voidSetCaptureVolume
voidSetPlaybackVolume
voidStartAudioCapture
voidStopAudioCapture
voidSetAudioProfile
voidSetAudioScenario
intEnableAudioPropertiesReport
intSetVoiceReverbType
voidSetEarMonitorMode
voidSetEarMonitorVolume
voidEnableVocalInstrumentBalance
intSetRemoteAudioPlaybackVolume
intSetDefaultAudioRoute
intSetAudioRoute
AudioRouteDeviceGetAudioRoute
intEnableAudioFrameCallback
intDisableAudioFrameCallback
intStartAudioRecording
intStopAudioRecording
intSendStreamSyncInfo
intSendSEIMessage
intEnableAudioProcessor
intDisableAudioProcessor
IAudioDeviceManagerGetAudioDeviceManager
IVideoDeviceManagerGetVideoDeviceManager
voidStartVideoCapture
voidStopVideoCapture
intSetVideoCaptureConfig
intSetVideoEncoderConfig1
intSetScreenVideoEncoderConfig
voidSetVideoSourceType
voidSetLocalVideoMirrorType
intSetVideoRotationMode
voidSetLocalVideoSink
voidSetRemoteVideoSink
IScreenCaptureSourceListGetScreenCaptureSourceList
intStartScreenVideoCapture
voidStopScreenVideoCapture
voidUpdateScreenCaptureRegion
voidUpdateScreenCaptureHighlightConfig
voidUpdateScreenCaptureMouseCursor
voidUpdateScreenCaptureFilterConfig
VideoFrameGetThumbnail
voidSetScreenAudioSourceType
voidSetScreenAudioStreamIndex
voidStartScreenAudioCapture
voidStopScreenAudioCapture
voidStartScreenCapture
intPushScreenAudioFrame
intSwitchCamera
intPushExternalAudioFrame
voidSetAudioSourceType
intPushExternalVideoFrame
intPushScreenVideoFrame
函数说明

CreateRTCVideo
int bytertc.IRTCVideo.CreateRTCVideo(
    RTCVideoEngineParams initParams)
csharp

创建 RTCVideoEngine 实例。
RTCVideoEngine 实例成功创建后,你才可以使用 SDK 提供的其他能力。

传入参数

参数名类型说明
initParamsRTCVideoEngineParams引擎初始化参数,参看 RTCVideoEngineParams。

Release
void bytertc.IRTCVideo.Release();
csharp

销毁由 CreateRTCVideo 所创建引擎实例,并释放所有相关资源。

注意

GetErrorDescription
string bytertc.IRTCVideo.GetErrorDescription(
    int code)
csharp

获取 SDK 内各种错误码、警告码的描述文字

传入参数

参数名类型说明
codeint警告码、错误码。

返回值
string 描述文字

GetSDKVersion
string bytertc.IRTCVideo.GetSDKVersion();
csharp

获取 SDK 当前的版本号。

返回值
SDK 当前的版本号。

SetBusinessId
int bytertc.IRTCVideo.SetBusinessId(
    string businessID)
csharp

设置业务标识参数。
可通过 businessId 区分不同的业务场景。businessId 由客户自定义,相当于一个“标签”,可以分担和细化现在 AppId 的逻辑划分的功能,但不需要鉴权。

传入参数

参数名类型说明
businessIDstring用户设置的自己的 businessId 值
businessId 只是一个标签,颗粒度需要用户自定义。

返回值

注意
需要在调用 JoinRoom 之前调用,之后调用该方法无效。

Feedback
int bytertc.IRTCVideo.Feedback(
    String roomID,
    String userID,
    List<int> typeArray,
    string problemDescription)
csharp

通话结束,将用户反馈的问题上报到 RTC。

传入参数

参数名类型说明
roomIDString房间 ID。
userIDString用户 ID。
typeArrayList预设问题列表,参看 ProblemFeedbackOption。
problemDescriptionstring预设问题以外的其他问题的具体描述。

返回值

注意

SetRuntimeParameters
void bytertc.IRTCVideo.SetRuntimeParameters(
    string jsonString)
csharp

设置运行时的参数。

传入参数

参数名类型说明
jsonStringstringjson 序列化之后的字符串。

CreateRTCRoom
IRTCVideoRoom bytertc.IRTCVideo.CreateRTCRoom(
    string roomID)
csharp

创建房间

传入参数

参数名类型说明
roomIDstring标识通话房间的房间 ID,最大长度为 128 字节的非空字符串。支持的字符集范围为:
• 26 个大写字母 A ~ Z
• 26 个小写字母 a ~ z
• 10 个数字 0 ~ 9
• 下划线 "_", at 符 "@", 减号 "-"
多房间模式下,调用创建房间接口后,请勿调用同样的 roomID 创建房间,否则会导致创建房间失败。

返回值
IRTCVideoRoom 创建的房间 IRTCVideoRoom

注意

SetCaptureVolume
void bytertc.IRTCVideo.SetCaptureVolume(
    StreamIndex index,
    int volume)
csharp

调节音频采集音量

传入参数

参数名类型说明
indexStreamIndex流索引,指定调节主流还是调节屏幕流的音量,参看 StreamIndex
volumeint采集的音量值和原始音量的比值,范围是 [0, 400],单位为 %,自带溢出保护。
为保证更好的通话质量,建议将 volume 值设为 [0,100]。
• 0:静音
• 100:原始音量
• 400: 最大可为原始音量的 4 倍(自带溢出保护)

注意
在开启音频采集前后,你都可以使用此接口设定采集音量。

SetPlaybackVolume
void bytertc.IRTCVideo.SetPlaybackVolume(
    int volume)
csharp

调节本地播放的所有远端用户混音后的音量。

传入参数

参数名类型说明
volumeint播放音量,调节范围:[0,400]
为保证更好的通话质量,建议将 volume 值设为 [0,100]。
• 0:静音
• 100:原始音量
• 400: 最大可为原始音量的 4 倍(自带溢出保护)

StartAudioCapture
void bytertc.IRTCVideo.StartAudioCapture();
csharp

开启内部音频采集。默认为关闭状态。
内部采集是指:使用 RTC SDK 内置的视频采集机制进行视频采集。
调用该方法开启后,本地用户会收到 OnAudioDeviceStateChangedEventHandler 的回调。
可见用户进房后调用该方法,房间中的其他用户会收到 OnUserStartAudioCaptureEventHandler 的回调。

注意

StopAudioCapture
void bytertc.IRTCVideo.StopAudioCapture();
csharp

立即关闭内部音频采集。默认为关闭状态。

内部采集是指:使用 RTC SDK 内置的视频采集机制进行视频采集。
调用该方法,本地用户会收到 OnAudioDeviceStateChangedEventHandler 的回调。

可见用户进房后调用该方法,房间中的其他用户会收到 OnUserStopAudioCaptureEventHandler 的回调。

注意

SetAudioProfile
void bytertc.IRTCVideo.SetAudioProfile(
    AudioProfileType audioProfile)
csharp

设置音质档位。你应根据业务场景需要选择适合的音质档位。

传入参数

参数名类型说明
audioProfileAudioProfileType音质档位,参看 AudioProfileType

注意

SetAudioScenario
void bytertc.IRTCVideo.SetAudioScenario(
    AudioScenarioType scenario)
csharp

设置音频场景类型

传入参数

参数名类型说明
scenarioAudioScenarioType音频场景类型,参看 AudioScenarioType 。

注意
该方法在进房前后均可调用。

EnableAudioPropertiesReport
int bytertc.IRTCVideo.EnableAudioPropertiesReport(
    AudioPropertiesConfig config)
csharp

启用音频信息提示。

传入参数

参数名类型说明
configAudioPropertiesConfig详见 AudioPropertiesConfig

注意
开启提示后,你可以: + 通过 OnLocalAudioPropertiesReportEventHandler 回调获取本地麦克风和屏幕音频流采集的音频信息;

SetVoiceReverbType
int bytertc.IRTCVideo.SetVoiceReverbType(
    VoiceReverbType type)
csharp

设置混响特效类型

传入参数

参数名类型说明
typeVoiceReverbType混响特效类型,参看 VoiceReverbType

注意

SetEarMonitorMode
void bytertc.IRTCVideo.SetEarMonitorMode(
    EarMonitorMode mode)
csharp

打开/关闭耳返功能。

传入参数

参数名类型说明
modeEarMonitorMode耳返功能是否开启,详见 EarMonitorMode。

注意

SetEarMonitorVolume
void bytertc.IRTCVideo.SetEarMonitorVolume(
    int volume)
csharp

设置耳返音量。

传入参数

参数名类型说明
volumeint耳返音量,调节范围:[0,100],单位:%

注意
设置耳返音量前,你必须先调用 SetEarMonitorMode 打开耳返功能。

EnableVocalInstrumentBalance
void bytertc.IRTCVideo.EnableVocalInstrumentBalance(
    bool enable)
csharp

开启/关闭音量均衡功能。

开启音量均衡功能后,人声的响度会调整为 -16lufs。

传入参数

参数名类型说明
enablebool是否开启音量均衡功能:
• True: 是
• False: 否

SetRemoteAudioPlaybackVolume
int bytertc.IRTCVideo.SetRemoteAudioPlaybackVolume(
    string roomID,
    string userID,
    int volume)
csharp

调节来自指定远端用户的音频播放音量,默认为 100。

传入参数

参数名类型说明
userIDstring音频来源的远端用户 ID
volumeint播放音量,调节范围:[0,400]
• 0: 静音
• 100: 原始音量
• 400: 最大可为原始音量的 4 倍(自带溢出保护)

SetDefaultAudioRoute
int bytertc.IRTCVideo.SetDefaultAudioRoute(
    AudioRouteDevice route)
csharp

将默认的音频播放设备设置为听筒或扬声器。

传入参数

参数名类型说明
routeAudioRouteDevice音频播放设备。参看 AudioRouteDevice。仅支持听筒或扬声器。

返回值

注意
对于音频路由切换逻辑,参见移动端设置音频路由。

SetAudioRoute
int bytertc.IRTCVideo.SetAudioRoute(
    AudioRouteDevice device)
csharp

设置当前音频播放路由。
音频播放路由发生变化时,会收到 OnAudioRouteChangedEventHandler 回调。

传入参数

参数名类型说明
deviceAudioRouteDevice音频播放路由,参见 AudioRouteDevice。
不支持 AudioRouteUnknown。
当音量类型为媒体音量时,此参数不可设置为 AudioRouteEarpiece;当音量模式为通话音量时,此参数不可设置为 AudioRouteHeadsetBluetooth 或 AudioRouteHeadsetUSB。

返回值

注意

GetAudioRoute
AudioRouteDevice bytertc.IRTCVideo.GetAudioRoute();
csharp

获取当前使用的音频播放路由。

返回值
详见 AudioRouteDevice

注意
要设置音频路由,详见 SetAudioRoute。

EnableAudioFrameCallback
int bytertc.IRTCVideo.EnableAudioFrameCallback(
    AudioFrameCallbackMethod method,
    AudioFormat format)
csharp

设置并开启指定的音频数据帧回调

传入参数

参数名类型说明
methodAudioFrameCallbackMethod音频回调方法,方法对应的回调名称参看 AudioFrameCallbackMethod。每次调用本接口设置一种回调。
当音频回调方法设置为 kAudioFrameCallbackRecord、kAudioFrameCallbackPlayback、kAudioFrameCallbackMixed、kAudioFrameCallbackRecordScreen时,你需要在参数 format 中指定准确的采样率和声道,暂不支持设置为自动。
当音频回调方法设置为 kAudioFrameCallbackRemoteUser时,暂不支持音频参数格式中设置准确的采样率和声道,你需要设置为自动。
formatAudioFormat音频参数格式,参看 AudioFormat。

返回值

DisableAudioFrameCallback
int bytertc.IRTCVideo.DisableAudioFrameCallback(
    AudioFrameCallbackMethod method)
csharp

关闭音频回调

传入参数

参数名类型说明
methodAudioFrameCallbackMethod音频回调方法,参看 AudioFrameCallbackMethod。

返回值

注意
该方法需要在调用 EnableAudioFrameCallback 之后调用。

StartAudioRecording
int bytertc.IRTCVideo.StartAudioRecording(
    AudioRecordingConfig config)
csharp

开启录制语音通话,生成本地文件。

传入参数

参数名类型说明
configAudioRecordingConfig参看 AudioRecordingConfig

返回值

注意

StopAudioRecording
int bytertc.IRTCVideo.StopAudioRecording();
csharp

停止音频文件录制

返回值

注意
调用 StartAudioRecording 开启本地录制后,你必须调用该方法停止录制。

SendStreamSyncInfo
int bytertc.IRTCVideo.SendStreamSyncInfo(
    byte[] data,
    int length,
    int stream_index,
    int repeat_count)
csharp

发送音频流同步信息。将消息通过音频流发送到远端,并实现与音频流同步,该接口调用成功后,远端用户会收到 OnStreamSyncInfoReceivedEventHandler 回调。

传入参数

参数名类型说明
databyte[]消息内容。
lengthint消息长度。取值范围是 [1,255] 字节,建议小于 16 字节,否则可能占用较大带宽。
stream_indexint指定携带 SEI 数据的媒体流类型,参看 StreamIndex。
语音通话场景下,该值需设为 kStreamIndexMain,否则 SEI 数据会被丢弃从而无法送达远端。
repeat_countint消息发送重复次数。取值范围是 [0, max{29, %{视频帧率}-1}]。推荐范围 [2,4]。
调用此接口后,SEI 数据会添加到从当前视频帧开始的连续 repeat_count+1 个视频帧中。

返回值

注意

SendSEIMessage
int bytertc.IRTCVideo.SendSEIMessage(
    byte[] data,
    int length,
    int stream_index,
    int repeat_count,
    int sei_mode)
csharp

通过视频帧发送 SEI 数据。
在视频通话场景下,SEI 数据会随视频帧发送;在语音通话场景下,SDK 会自动生成一路 16px × 16px 的黑帧视频流用来发送 SEI 数据。

传入参数

参数名类型说明
databyte[]SEI 消息。
lengthintSEI 消息长度,建议每帧 SEI 数据总长度长度不超过 4 KB。
stream_indexint指定携带 SEI 数据的媒体流类型,参看 StreamIndex。
语音通话场景下,该值需设为 kStreamIndexMain,否则 SEI 数据会被丢弃从而无法送达远端。
repeat_countint消息发送重复次数。取值范围是 [0, max{29, %{视频帧率}-1}]。推荐范围 [2,4]。
调用此接口后,SEI 数据会添加到从当前视频帧开始的连续 repeat_count+1 个视频帧中。
sei_modeintSEI 发送模式。
• 0: 单发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 按队列逐帧发送。
• 1: 多发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 随下个视频帧同时发送。

返回值

注意

EnableAudioProcessor
int bytertc.IRTCVideo.EnableAudioProcessor(
    AudioProcessorMethod method,
    AudioFormat format)
csharp

设置并开启指定的音频帧回调,进行自定义处理。

传入参数

参数名类型说明
methodAudioProcessorMethod音频帧类型,参看 AudioProcessorMethod。可多次调用此接口,处理不同类型的音频帧。
选择不同类型的音频帧将收到对应的回调:
• 选择本地采集的音频时,会收到 OnProcessRecordAudioFrameEventHandler。
• 选择远端音频流的混音音频时,会收到 OnProcessPlaybackAudioFrameEventHandler。
• 选择远端音频流时,会收到 OnProcessRemoteUserAudioFrameEventHandler。
• 选择软件耳返音频时,会收到 OnProcessEarMonitorAudioFrameEventHandler。
• 选择屏幕共享音频流时,会收到 OnProcessScreenAudioFrameEventHandler。
formatAudioFormat设定自定义处理时获取的音频帧格式,参看 AudioFormat。

返回值

注意
要关闭音频自定义处理,调用 DisableAudioProcessor。

DisableAudioProcessor
int bytertc.IRTCVideo.DisableAudioProcessor(
    AudioProcessorMethod method)
csharp

关闭自定义音频处理。

传入参数

参数名类型说明
methodAudioProcessorMethod音频帧类型,参看 AudioProcessorMethod。

返回值

GetAudioDeviceManager
IAudioDeviceManager bytertc.IRTCVideo.GetAudioDeviceManager();
csharp

获取音频设备管理接口,该接口依赖引擎

返回值
音频设备管理接口

GetVideoDeviceManager
IVideoDeviceManager bytertc.IRTCVideo.GetVideoDeviceManager();
csharp

获取视频设备管理接口

返回值
视频设备管理接口

StartVideoCapture
void bytertc.IRTCVideo.StartVideoCapture();
csharp

立即开启内部视频采集。默认为关闭状态。
内部视频采集指:使用 RTC SDK 内置视频采集模块,进行采集。
调用该方法后,本地用户会收到 OnVideoDeviceStateChangedEventHandler 的回调。
本地用户在非隐身状态下调用该方法后,房间中的其他用户会收到 OnUserStartVideoCaptureEventHandler 的回调。

注意

StopVideoCapture
void bytertc.IRTCVideo.StopVideoCapture();
csharp

立即关闭内部视频采集。默认为关闭状态。
内部视频采集指:使用 RTC SDK 内置视频采集模块,进行采集。
调用该方法,本地用户会收到 OnVideoDeviceStateChangedEventHandler 的回调。
可见用户进房后调用该方法,房间中的其他用户会收到 OnUserStopVideoCaptureEventHandler 的回调。

注意

SetVideoCaptureConfig
int bytertc.IRTCVideo.SetVideoCaptureConfig(
    VideoCaptureConfig videoCaptureConfig)
csharp

设置 RTC SDK 内部采集时的视频采集参数。

如果你的项目使用了 SDK 内部采集模块,可以通过本接口指定视频采集参数包括模式、分辨率、帧率。

传入参数

参数名类型说明
videoCaptureConfigVideoCaptureConfig视频采集参数。参看 VideoCaptureConfig。

返回值

注意

SetVideoEncoderConfig1
int bytertc.IRTCVideo.SetVideoEncoderConfig1(
    VideoEncoderConfig maxSolution)
csharp

视频发布端设置期望发布的最大分辨率视频流参数,包括分辨率、帧率、码率、缩放模式、网络不佳时的回退策略等。

传入参数

参数名类型说明
maxSolutionVideoEncoderConfig期望发布的最大分辨率视频流参数。参看 VideoEncoderConfig。

返回值

注意

SetScreenVideoEncoderConfig
int bytertc.IRTCVideo.SetScreenVideoEncoderConfig(
    ScreenVideoEncoderConfig screenSolution)
csharp

为发布的屏幕共享视频流设置期望的编码参数,包括分辨率、帧率、码率、缩放模式、网络不佳时的回退策略等。

传入参数

参数名类型说明
screenSolutionScreenVideoEncoderConfig屏幕共享视频流参数。参看 ScreenVideoEncoderConfig。

返回值
方法调用结果:
0:成功
!0:失败

注意
调用该方法之前,屏幕共享视频流默认的编码参数为:分辨率 1920px × 1080px,帧率 15fps。

SetVideoSourceType
void bytertc.IRTCVideo.SetVideoSourceType(
    StreamIndex streamIndex,
    VideoSourceType type)
csharp

设置向 SDK 输入的视频源,包括屏幕流。
默认使用内部采集。内部采集指:使用 RTC SDK 内置的视频采集机制进行视频采集。

传入参数

参数名类型说明
streamIndexStreamIndex视频流的属性,参看 StreamIndex。
typeVideoSourceType视频输入源类型,参看 VideoSourceType。

注意

SetLocalVideoMirrorType
void bytertc.IRTCVideo.SetLocalVideoMirrorType(
    MirrorType mirrorType)
csharp

为采集到的视频流开启镜像

传入参数

参数名类型说明
mirrorTypeMirrorType镜像类型,参看 MirrorType

注意

前置摄像头后置摄像头自定义采集视频源 桌面端摄像头
移动端本地预览镜像,编码传输不镜像 本地预览不镜像,编码传输不镜像 本地预览不镜像,编码传输不镜像 /
桌面端// 本地预览不镜像,编码传输不镜像 本地预览镜像,编码传输不镜像

SetVideoRotationMode
int bytertc.IRTCVideo.SetVideoRotationMode(
    VideoRotationMode rotationMode)
csharp

设置采集视频的旋转模式。默认以 App 方向为旋转参考系。

接收端渲染视频时,将按照和发送端相同的方式进行旋转。

传入参数

参数名类型说明
rotationModeVideoRotationMode视频旋转参考系为 App 方向或重力方向,参看 VideoRotationMode

返回值

注意

SetLocalVideoSink
void bytertc.IRTCVideo.SetLocalVideoSink(
    StreamIndex index,
    VideoSinkPixelFormat requiredFormat)
csharp

将本地视频流与自定义渲染器绑定。

传入参数

参数名类型说明
indexStreamIndex视频流属性。采集的视频流/屏幕视频流,参看 StreamIndex
requiredFormatVideoSinkPixelFormatvideoSink 适用的视频帧编码格式,参看 VideoSinkPixelFormat

注意

SetRemoteVideoSink
void bytertc.IRTCVideo.SetRemoteVideoSink(
    RemoteStreamKey streamKey,
    VideoSinkPixelFormat requiredFormat)
csharp

将远端视频流与自定义渲染器绑定。

传入参数

参数名类型说明
streamKeyRemoteStreamKey远端流信息,用于指定需要渲染的视频流来源及属性,参看 RemoteStreamKey
requiredFormatVideoSinkPixelFormatvideoSink 适用的视频帧编码格式,参看 VideoSinkPixelFormat

注意

GetScreenCaptureSourceList
IScreenCaptureSourceList bytertc.IRTCVideo.GetScreenCaptureSourceList();
csharp

获取共享对象(应用窗口和桌面)列表, 使用完之后需要调用对应的 release 接口释放

返回值
屏幕共享对象列表,参看 IScreenCaptureSourceList

注意

StartScreenVideoCapture
int bytertc.IRTCVideo.StartScreenVideoCapture(
    ScreenCaptureSourceInfo sourceInfo,
    ScreenCaptureParameters captureParams)
csharp

使用 RTC SDK 提供的采集模块,采集当前屏幕视频流,用于共享。

传入参数

参数名类型说明
sourceInfoScreenCaptureSourceInfo屏幕共享对象信息。参看 ScreenCaptureSourceInfo。
captureParamsScreenCaptureParameters屏幕采集参数。参看 ScreenCaptureParameters。

返回值

注意

StopScreenVideoCapture
void bytertc.IRTCVideo.StopScreenVideoCapture();
csharp

停止屏幕视频流采集。

返回值

注意
调用此接口不影响屏幕视频流发布状态。

UpdateScreenCaptureRegion
void bytertc.IRTCVideo.UpdateScreenCaptureRegion(
    Rectangle regionRect)
csharp

通过 RTC SDK 提供的采集模块采集屏幕视频流时,更新采集区域。

传入参数

参数名类型说明
regionRectRectangle采集区域。参见 Rectangle
此参数描述了调用此接口后的采集区域,和 StartScreenVideoCapture 中 source_info 设定区域的相对关系。

注意
调用此接口前,必须已通过调用 StartScreenVideoCapture 开启了内部屏幕流采集。

UpdateScreenCaptureHighlightConfig
void bytertc.IRTCVideo.UpdateScreenCaptureHighlightConfig(
    HighlightConfig highlightConfig)
csharp

通过 RTC SDK 提供的采集模块采集屏幕视频流时,更新边框高亮设置。默认展示表框。

传入参数

参数名类型说明
highlightConfigHighlightConfig边框高亮设置。参见 HighlightConfig

注意
调用此接口前,必须已通过调用 StartScreenVideoCapture 开启了内部屏幕流采集。

UpdateScreenCaptureMouseCursor
void bytertc.IRTCVideo.UpdateScreenCaptureMouseCursor(
    MouseCursorCaptureState captureMouseCursor)
csharp

通过 RTC SDK 提供的采集模块采集屏幕视频流时,更新对鼠标的处理设置。默认采集鼠标。

传入参数

参数名类型说明
captureMouseCursorMouseCursorCaptureState参看 MouseCursorCaptureState

注意
调用此接口前,必须已通过调用 StartScreenVideoCapture 开启了内部屏幕流采集。

UpdateScreenCaptureFilterConfig
void bytertc.IRTCVideo.UpdateScreenCaptureFilterConfig(
    ScreenFilterConfig filterConfig)
csharp

通过 RTC SDK 提供的采集模块采集屏幕视频流时,设置需要过滤的窗口。

传入参数

参数名类型说明
filterConfigScreenFilterConfig窗口过滤设置,参看 ScreenFilterConfig

注意

GetThumbnail
VideoFrame bytertc.IRTCVideo.GetThumbnail(
    ScreenCaptureSourceType type,
    IntPtr sourceID,
    int maxWidth,
    int maxHeight)
csharp

获取共享对象缩略图

传入参数

参数名类型说明
typeScreenCaptureSourceType屏幕采集对象的类型。详见 ScreenCaptureSourceType。
sourceIDIntPtr屏幕分享时,共享对象的 ID。
maxWidthint最大宽度
maxHeightint最大高度

SetScreenAudioSourceType
void bytertc.IRTCVideo.SetScreenAudioSourceType(
    AudioSourceType sourceType)
csharp

在屏幕共享时,设置屏幕音频的采集方式(内部采集/自定义采集)

传入参数

参数名类型说明
sourceTypeAudioSourceType屏幕音频输入源类型, 参看 AudioSourceType。

注意

SetScreenAudioStreamIndex
void bytertc.IRTCVideo.SetScreenAudioStreamIndex(
    StreamIndex index)
csharp

在屏幕共享时,设置屏幕音频流和麦克风采集到的音频流的混流方式

传入参数

参数名类型说明
indexStreamIndex混流方式,参看 StreamIndex
• kStreamIndexMain: 将屏幕音频流和麦克风采集到的音频流混流
• kStreamIndexScreen: 将屏幕音频流和麦克风采集到的音频流分为两路音频流

注意
你应该在 PublishScreen 之前,调用此方法。否则,你将收到 OnWarningEventHandler 的报错:WARNING_CODE_SET_SCREEN_STREAM_INDEX_FAILED

StartScreenAudioCapture
void bytertc.IRTCVideo.StartScreenAudioCapture();
csharp

在屏幕共享时,开始使用 RTC SDK 内部采集方式,采集屏幕音频

注意

StopScreenAudioCapture
void bytertc.IRTCVideo.StopScreenAudioCapture();
csharp

在屏幕共享时,停止使用 RTC SDK 内部采集方式,采集屏幕音频。

注意

StartScreenCapture
void bytertc.IRTCVideo.StartScreenCapture(
    ScreenMediaType type,
    string bundleId)
csharp

使用 RTC SDK 内部采集模块开始采集屏幕音频流和(或)视频流。

传入参数

参数名类型说明
typeScreenMediaType媒体类型,参看 ScreenMediaType。
bundleIdstring绑定 Extension 的 Bundle ID,绑定后在应用中,共享屏幕的选择列表中只展示你的 Extension 可供选择。

注意

PushScreenAudioFrame
int bytertc.IRTCVideo.PushScreenAudioFrame(
    AudioFrame frame)
csharp

使用自定义采集方式,采集屏幕共享时的屏幕音频时,将音频帧推送至 RTC SDK 处进行编码等处理。

传入参数

参数名类型说明
frameAudioFrame音频数据帧,参见 AudioFrame。
  • 音频采样格式必须为 S16。音频缓冲区内的数据格式必须为 PCM,其容量大小应该为 audioFrame.samples × audioFrame.channel × 2。
  • 必须指定具体的采样率和声道数,不支持设置为自动。

返回值

注意

SwitchCamera
int bytertc.IRTCVideo.SwitchCamera(
    CameraID cameraId)
csharp

切换视频内部采集时使用的前置/后置摄像头

调用此接口后,在本地会触发 OnVideoDeviceStateChangedEventHandler 回调。

传入参数

参数名类型说明
cameraIdCameraIDCamera ID,移动端摄像头。参看 CameraID。

返回值

注意

PushExternalAudioFrame
int bytertc.IRTCVideo.PushExternalAudioFrame(
    AudioFrame frame)
csharp

推送自定义采集的音频数据到 RTC SDK。

传入参数

参数名类型说明
frameAudioFrame音频数据帧,参看 AudioFrame。
  • 音频采样格式必须为 S16。音频缓冲区内的数据格式必须为 PCM,其容量大小应该为 audioFrame.samples × audioFrame.channel × 2。
  • 必须指定具体的采样率和声道数,不支持设置为自动。

返回值

注意

SetAudioSourceType
void bytertc.IRTCVideo.SetAudioSourceType(
    AudioSourceType sourceType)
csharp

切换音频采集方式

传入参数

参数名类型说明
sourceTypeAudioSourceType音频数据源,参看 AudioSourceType。
默认使用内部音频采集。音频采集和渲染方式无需对应。

返回值

注意

PushExternalVideoFrame
int bytertc.IRTCVideo.PushExternalVideoFrame(
    VideoFrame frame)
csharp

推送外部视频帧。

传入参数

参数名类型说明
frameVideoFrame视频帧的数据信息,参看 VideoFrame。

返回值

注意

PushScreenVideoFrame
int bytertc.IRTCVideo.PushScreenVideoFrame(
    VideoFrame frame)
csharp

推送屏幕视频帧

传入参数

参数名类型说明
frameVideoFrame视频帧 VideoFrame

返回值

IRTCVideoRoom
public interface bytertc.IRTCVideoRoom
csharp

房间接口

Defined in : IRTCVideoRoom.cs

成员函数
返回名称
voidDestroy
intJoinRoom
voidLeaveRoom
voidUpdateToken
voidSetUserVisibility
voidPublishStream
voidUnpublishStream
voidPublishScreen
voidUnpublishScreen
voidSubscribeStream
voidUnsubscribeStream
voidSubscribeScreen
voidUnsubscribeScreen
voidPauseAllSubscribedStream
voidResumeAllSubscribedStream
intSubscribeAllStreams
intUnsubscribeAllStreams
IRangeAudioGetRangeAudio
ISpatialAudioGetSpatialAudio
longSendUserMessage
longSendRoomMessage
函数说明

Destroy
void bytertc.IRTCVideoRoom.Destroy();
csharp

退出并销毁调用 CreateRTCRoom 所创建的房间。

JoinRoom
int bytertc.IRTCVideoRoom.JoinRoom(
    string token,
    UserInfo info,
    MultiRoomConfig roomConfig)
csharp

加入房间。
调用 CreateRTCRoom 创建房间后,调用此方法加入房间,同房间内其他用户进行音视频通话。

传入参数

参数名类型说明
tokenstring动态密钥,用于对进房用户进行鉴权验证。
进入房间需要携带 Token。测试时可使用控制台生成临时 Token,正式上线需要使用密钥 SDK 在你的服务端生成并下发 Token。
使用不同 AppID 的 App 是不能互通的。
请务必保证生成 Token 使用的 AppID 和创建引擎时使用的 AppID 相同,否则会导致加入房间失败。
infoUserInfo用户信息。参看 UserInfo。
roomConfigMultiRoomConfig房间参数配置,设置房间模式以及是否自动发布或订阅流。具体配置模式参看 MultiRoomConfig。

返回值

注意

LeaveRoom
void bytertc.IRTCVideoRoom.LeaveRoom();
csharp

离开房间。

用户调用此方法离开房间,结束通话过程,释放所有通话相关的资源。

调用 JoinRoom 方法加入房间后,必须调用此方法结束通话,否则无法开始下一次通话。无论当前是否在房间内,都可以调用此方法。重复调用此方法没有负面影响。

此方法是异步操作,调用返回时并没有真正退出房间。真正退出房间后,本地会收到 OnLeaveRoomEventHandler 回调通知。

注意

UpdateToken
void bytertc.IRTCVideoRoom.UpdateToken(
    string token)
csharp

更新 Token。
收到 OnTokenWillExpireEventHandler 时,你必须重新获取 Token,并调用此方法更新 Token,以保证通话的正常进行。

传入参数

参数名类型说明
tokenstring重新获取的有效 Token。
如果 Token 无效,你会收到 OnRoomStateChangedEventHandler,错误码是 -1010。

SetUserVisibility
void bytertc.IRTCVideoRoom.SetUserVisibility(
    bool enable)
csharp

设置用户可见性。默认可见。

传入参数

参数名类型说明
enablebool设置用户是否对房间内其他用户可见:
• true: 可以在房间内发布音视频流,房间中的其他用户将收到用户的行为通知,例如进房、开启视频采集和退房。
• false: 不可以在房间内发布音视频流,房间中的其他用户不会收到用户的行为通知,例如进房、开启视频采集和退房。

注意

PublishStream
void bytertc.IRTCVideoRoom.PublishStream(
    MediaStreamType type)
csharp

在当前所在房间内发布本地通过摄像头/麦克风采集的媒体流

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定发布音频/视频,参看 MediaStreamType

注意

UnpublishStream
void bytertc.IRTCVideoRoom.UnpublishStream(
    MediaStreamType type)
csharp

停止将本地摄像头/麦克风采集的媒体流发布到当前所在房间中

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定停止发布音频/视频,参看 MediaStreamType

注意

PublishScreen
void bytertc.IRTCVideoRoom.PublishScreen(
    MediaStreamType type)
csharp

在当前所在房间内发布本地屏幕共享音视频流

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定发布屏幕音频/视频,参看 MediaStreamType。

注意

UnpublishScreen
void bytertc.IRTCVideoRoom.UnpublishScreen(
    MediaStreamType type)
csharp

停止将本地屏幕共享音视频流发布到当前所在房间中

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定停止发布屏幕音频/视频,参看 MediaStreamType

注意

SubscribeStream
void bytertc.IRTCVideoRoom.SubscribeStream(
    string userID,
    MediaStreamType type)
csharp

订阅房间内指定的通过摄像头/麦克风采集的媒体流,或更新对指定远端用户的订阅选项。

传入参数

参数名类型说明
userIDstring指定订阅的远端发布音视频流的用户 ID。
typeMediaStreamType媒体流类型,用于指定订阅音频/视频。参看 MediaStreamType。

注意

UnsubscribeStream
void bytertc.IRTCVideoRoom.UnsubscribeStream(
    string userID,
    MediaStreamType type)
csharp

取消订阅房间内指定的通过摄像头/麦克风采集的媒体流。

该方法对自动订阅和手动订阅模式均适用。

传入参数

参数名类型说明
userIDstring指定取消订阅的远端发布音视频流的用户 ID。
typeMediaStreamType媒体流类型,用于指定取消订阅音频/视频。参看 MediaStreamType。

注意

SubscribeScreen
void bytertc.IRTCVideoRoom.SubscribeScreen(
    string userID,
    MediaStreamType type)
csharp

订阅房间内指定的远端屏幕共享音视频流,或更新对指定远端用户的订阅选项

传入参数

参数名类型说明
userIDstring指定订阅的远端发布屏幕流的用户 ID。
typeMediaStreamType媒体流类型,用于指定订阅音频/视频。参看 MediaStreamType。

注意

UnsubscribeScreen
void bytertc.IRTCVideoRoom.UnsubscribeScreen(
    string userID,
    MediaStreamType type)
csharp

取消订阅房间内指定的远端屏幕共享音视频流。
该方法对自动订阅和手动订阅模式均适用。

传入参数

参数名类型说明
userIDstring指定取消订阅的远端发布屏幕流的用户 ID。
typeMediaStreamType媒体流类型,用于指定取消订阅音频/视频。参看 MediaStreamType。

注意

PauseAllSubscribedStream
void bytertc.IRTCVideoRoom.PauseAllSubscribedStream(
    PauseResumeControlMediaType mediaType)
csharp

暂停接收来自远端的媒体流。

传入参数

参数名类型说明
mediaTypePauseResumeControlMediaType媒体流类型,指定需要暂停接收音频还是视频流,参看 PauseResumeControlMediaType。

注意

ResumeAllSubscribedStream
void bytertc.IRTCVideoRoom.ResumeAllSubscribedStream(
    PauseResumeControlMediaType mediaType)
csharp

恢复接收来自远端的媒体流

传入参数

参数名类型说明
mediaTypePauseResumeControlMediaType媒体流类型,指定需要暂停接收音频还是视频流,参看 PauseResumeControlMediaType

注意

SubscribeAllStreams
int bytertc.IRTCVideoRoom.SubscribeAllStreams(
    MediaStreamType type)
csharp

订阅房间内所有通过摄像头/麦克风采集的媒体流,或更新订阅选项。

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定订阅音频/视频。参看 MediaStreamType。

返回值

0: 方法调用成功
!0: 方法调用失败

注意

UnsubscribeAllStreams
int bytertc.IRTCVideoRoom.UnsubscribeAllStreams(
    MediaStreamType type)
csharp

取消订阅房间内所有的通过摄像头/麦克风采集的媒体流。

自动订阅和手动订阅的流都可以通过本方法取消订阅。

传入参数

参数名类型说明
typeMediaStreamType媒体流类型,用于指定取消订阅音频/视频。参看 MediaStreamType。

返回值
方法调用结果:

注意

GetRangeAudio
IRangeAudio bytertc.IRTCVideoRoom.GetRangeAudio();
csharp

获取范围语音接口。

返回值
范围语音接口,参看 IRangeAudio。

GetSpatialAudio
ISpatialAudio bytertc.IRTCVideoRoom.GetSpatialAudio();
csharp

获取空间音频接口。

返回值
空间音频接口,参看 IRangeAudio。

SendUserMessage
long bytertc.IRTCVideoRoom.SendUserMessage(
    string userID,
    string message)
csharp

给房间内指定的用户发送点对点文本消息(P2P)。

传入参数

参数名类型说明
userIDstring消息接收用户的 ID
messagestring发送的文本消息内容。消息不超过 64 KB。

返回值

注意
在发送房间内文本消息前,必须先调用 JoinRoom 加入房间。

SendRoomMessage
long bytertc.IRTCVideoRoom.SendRoomMessage(
    string message)
csharp

给房间内的所有其他用户群发文本消息。

传入参数

参数名类型说明
messagestring发送的文本消息内容,消息不超过 64 KB。

注意
在房间内广播文本消息前,必须先调用 JoinRoom 加入房间。

IScreenCaptureSourceList
public interface bytertc.IScreenCaptureSourceList
csharp

屏幕源类型信息列表

Defined in : IScreenCaptureSourceList.cs

成员函数
返回名称
intGetCount
ScreenCaptureSourceInfoGetSourceInfo
voidRelease
函数说明

GetCount
int bytertc.IScreenCaptureSourceList.GetCount();
csharp

获取列表大小

返回值
获取列表大小

GetSourceInfo
ScreenCaptureSourceInfo bytertc.IScreenCaptureSourceList.GetSourceInfo(
    int index)
csharp

根据索引号,获取屏幕共享列表中的元素。

传入参数

参数名类型说明
indexint列表索引号

返回值
屏幕源类型信息,参看 ScreenCaptureSourceInfo。

注意
返回类型中有 char* 类型的字符串,该字符串在本对象 Release 后释放,请注意内存管理。

Release
void bytertc.IScreenCaptureSourceList.Release();
csharp

析构当前对象,释放内存

注意
严禁调用 delete 该结构体,该结构不需要的时候应该调用本函数释放资源

ISpatialAudio
public interface bytertc.ISpatialAudio
csharp

空间音频接口

Defined in : ISpatialAudio.cs

成员函数
返回名称
voidEnableSpatialAudio
intUpdatePosition
intUpdateSelfOrientation
voidDisableRemoteOrientation
voidRelease
函数说明

EnableSpatialAudio
void bytertc.ISpatialAudio.EnableSpatialAudio(
    bool enable)
csharp

设置是否开启空间语音

传入参数

参数名类型说明
enablebool• true:开启
• false: 关闭(默认设置)

注意
开启空间语音后,非同一小队的队友之间收听的声音会根据设置的坐标和方位不同而产生空间音效,如果不需要设置为 false 即可。

UpdatePosition
int bytertc.ISpatialAudio.UpdatePosition(
    Position pos)
csharp

更新本地用户发声时,在房间内空间直角坐标系中的位置坐标。

传入参数

参数名类型说明
posPosition三维坐标的值,默认为 [0, 0, 0]。参看 Position。

返回值

注意
调用该接口更新坐标前,你需调用 EnableSpatialAudio 开启空间音频功能。空间音频相关 API 和调用时序详见空间音频。

UpdateSelfOrientation
int bytertc.ISpatialAudio.UpdateSelfOrientation(
    HumanOrientation orientation)
csharp

更新自己的朝向。本地朝向的设置只影响本地听到的音频效果,不影响本地发出的音频效果。

传入参数

参数名类型说明
orientationHumanOrientation朝向信息,必须是单位向量。参看 HumanOrientation。当朝向的正方向使用默认值时,朝向的坐标系和位置信息使用的坐标系一致。此时,正前方朝向是:[1, 0, 0],正右方朝向是:[0, 1, 0],正上方朝向是:[0, 0, 1]。

返回值
0: 更新成功

注意
本地用户调用 EnableSpatialAudio 使用空间音频功能时,需要调用 UpdatePosition 接口更新位置坐标后,才能调用此接口。

DisableRemoteOrientation
void bytertc.ISpatialAudio.DisableRemoteOrientation();
csharp

关闭本地用户朝向对本地用户发声效果的影响。

调用此接口后,房间内的其他用户收听本地发声时,声源都在收听者正面。

注意

Release
void bytertc.ISpatialAudio.Release();
csharp

释放当前 ISpatialAudio 对象占用的资源。

IVideoDeviceManager
public interface bytertc.IVideoDeviceManager
csharp

主要用于枚举、设置视频采集设备

Defined in : IVideoDeviceManager.cs

成员函数
返回名称
IDeviceCollectionEnumerateVideoCaptureDevices
intSetVideoCaptureDevice
intGetVideoCaptureDevice
函数说明

EnumerateVideoCaptureDevices
IDeviceCollection bytertc.IVideoDeviceManager.EnumerateVideoCaptureDevices();
csharp

获取当前系统内视频采集设备列表。

返回值
包含系统中所有视频采集设备的列表,参看 IDeviceCollection。

SetVideoCaptureDevice
int bytertc.IVideoDeviceManager.SetVideoCaptureDevice(
    string deviceID)
csharp

设置当前视频采集设备

传入参数

参数名类型说明
deviceIDstring视频设备 ID,可以通过 EnumerateVideoCaptureDevices 获取

返回值

GetVideoCaptureDevice
int bytertc.IVideoDeviceManager.GetVideoCaptureDevice(
    ref string deviceID)
csharp

获取当前 SDK 正在使用的视频采集设备信息

传入参数

参数名类型说明
deviceIDref string视频设备 ID

返回值