import { NEDeviceBaseInfo, NEDeviceSwitchInfo, NEMediaTypes, NEResult, NERoomCreateAudioEffectOption, NERoomCreateAudioMixingOption, NERoomRtcAudioRecvStats, NERoomRtcAudioSendStats, NERoomRtcStats, NERoomRtcVideoRecvStats, NERoomRtcVideoSendStats, NERoomMember, DeviceType, NERoomRtcTransportStats, NERoomRtcVideoLayerRecvStats, Controller, NERoomVideoView, AudioProfile, NEEncryptionMode, NERoomRtcScreenCaptureSource, NERoomScreenConfig, NERoomStopScreenConfig, NERoomRectShareConfig, NERoomVideoConfig, NEVideoStreamType, VideoFrameRate, VideoResolution, NERoomLiveStreamTaskInfo, NERoomVirtualBackgroundSupportedType, NERoomStartLocalRecordOptions, NERoomUpdateLocalRecordLayoutsOptions, NERoomStreamLayer, NERoomVideoFrame, NERoomRtcTransportType, NERoomAudioAINSMode, NERoomBeautyEffectType, NERoomVideoLowlightEnhanceLevel, NERoomUpdateScreenSharingOption, } from './commonTypes' import { Client } from 'nertc-web-sdk/types/client' import { ReverbConfig } from 'nertc-web-sdk/types/types' export interface NERoomRtcController extends Controller { /** * @ignore */ rtcClient: Client /** * @ignore */ muteMyAudioTimer: null | ReturnType // 本端静音请求失败重试timer /** * @ignore */ muteMyVideoTimer: null | ReturnType // 本端关闭视频请求失败重试timer /** * 加入音视频房间 * @param channelName 频道名称,如果为空则默认加入主房间 * @param mixRemoteAudioStream 是否开启远端音频流混流。默认为 false。h5端可开启该选项。 */ joinRtcChannel: ( channelName?: string, mixRemoteAudioStream?: boolean ) => Promise> /** * 离开音视频房间 * @param channelName 频道名称,如果为空则默认离开主房间 */ leaveRtcChannel: (channelName?: string) => Promise> /** * 设置远端音频播放是否需要混音 */ setMixAudioStream?: (need: boolean) => void /** * 开启或关闭对应频道本地媒体流(主流)的发送。 该方法用于开始或停止向网络发送本地音频或视频数据。 * 该方法不影响接收或播放远端媒体流,也不会影响本地音频或视频的采集状态。 * 该方法在加入房间前后均可调用。 * * @param channelName 频道名称 * @param mediaType 媒体发布类型,暂时仅支持音频。取值参考 [NERoomRtcMediaPublishType] * @param enable 是否发布本地媒体流。true(默认):发布本地媒体流。false:不发布本地媒体流。 */ enableMediaPub: ( channelName: string, mediaType: number, enable: boolean ) => Promise> /** * 调节对应房间本地播放的所有远端用户的信号音量。通过此接口可以实现调节所有远端用户在本地播放的混音音量。 * * @param channelName 频道名称 * @param volume 采集信号音量,取值范围为 [0, 400]。0:静音。100:(默认)原始音量。400:最大可为原始音量的 4 倍(自带溢出保护) * @return 0 成功,否则失败 */ adjustChannelPlaybackSignalVolume: ( channelName: string, volume: number ) => void /** * 开启/关闭本地音频设备 * @param [channelName] 频道名称 * @param [enable] 是否开启 */ enableLocalAudio: ( channelName: string, enable: boolean ) => Promise> /** * 启用说话者音量提示。 * 该方法允许 SDK 定期向 App 反馈本地发流用户和瞬时音量最高的远端用户(最多 3 位)的音量相关信息, * 即当前谁在说话以及说话者的音量。启用该方法后,只要房间内有发流用户,无论是否有人说话, * SDK 都会在加入房间后根据预设的时间间隔触发 [NERoomListener.onRtcRemoteAudioVolumeIndication] 回调 * @param channelName 频道名称 * @param enable 是否启用说话者音量提示。 * @param enableVad 是否启用本地采集人声监测。 */ enableAudioVolumeIndication: ( enable: boolean, interval: number, enableVad: boolean, channelName?: string ) => void /** * 返回本端音频发送音量 * @param channelName 对应频道 */ getLocalAudioLevel: (channelName?: string) => number /** * 断开音频,音频断开后将会中断自己与房间里其他人的音频互通 */ disconnectMyAudio: () => Promise> /** * 恢复音频,恢复音频后将恢复自己与其他人的音频互通,但是具体音频是否可听见还是取决于成员的mute状态 */ reconnectMyAudio: () => Promise> /** * 关闭本端音频发送 * 该方法用于禁止上行本地音频流 */ muteMyAudio: () => Promise> /** * 关闭本端视频 * @param callback 回调 */ muteMyVideo: () => Promise> // todo 需要确定添加逻辑 // enableMyAudio: () => Promise> // disableMyAudio: () => Promise> // enableMyVideo: () => Promise> // disableMyVideo: () => Promise> /** * 设置本地视图 * @param videoView 视频画布 */ setupLocalVideoCanvas: (videoView: NERoomVideoView) => number /** *@ignore 内部使用 Electron, 移除本地视图 */ removeLocalVideoCanvas?: (videoView?: HTMLElement) => void /** * @ignore */ setRemoteMemberMap: (remoteMemberMap: Map) => NEResult // 内部使用 /** * @ignore */ setLocalMember: (localMember: NERoomMember) => NEResult /** * 设置远端的辅流视频画布 * @param videoView 视频画布 * @param userUuid 用户id */ setupRemoteVideoSubStreamCanvas: ( videoView: NERoomVideoView, userUuid: string ) => number /** *@ignore 内部使用 Electron, 移除远端的辅流视频画布 */ removeRemoteVideoSubStreamCanvas?: ( userUuid: string, videoView?: HTMLElement ) => void /** * 设置远端用户视图 * @param videoView 视频画布 * @param userUuid 用户id */ setupRemoteVideoCanvas: ( videoView: NERoomVideoView, userUuid: string ) => number /** *@ignore 内部使用 Electron, 移除远端用户视图 */ removeRemoteVideoCanvas?: (userUuid: string, videoView?: HTMLElement) => void // setVideoFrameCallback: (textureWithI420: boolean, callback?: (videoFrame: NERoomVideoFrame) => boolean) => void; /** * 查询屏幕共享者的userUuid */ getScreenSharingUserUuid: () => string // 内部调用不暴露 /** * @ignore */ setScreenSharingUserUuid: (userUuid: string) => void /** * @ignore 内部使用 */ _getRtcUidByUuid: (userUuid: string) => number | undefined /** * @ignore 内部使用 */ _getUuidByRtcUid: (rtcUid: string) => string // startPreview: (videoView: NERoomVideoView, callback?: NECallback) => void; /** * 开启本端屏幕共享 */ startScreenShare: ( screenConfig?: NERoomScreenConfig, stopCurrentShare?: boolean ) => Promise> /** * 开启本端矩形区域共享 */ startRectShare?: ( screenConfig: NERoomRectShareConfig, stopCurrentShare?: boolean ) => Promise> // stopPreview: (callback?: NECallback) => void; /** * 关闭本端屏幕共享 */ stopScreenShare: ( screenConfig?: NERoomStopScreenConfig ) => Promise> /** * 更新屏幕共享参数(仅electron支持) * @param option 屏幕共享参数 */ updateScreenCaptureParameters?: ( option: NERoomUpdateScreenSharingOption ) => Promise> /** * 尝试关闭房间内成员的屏幕共享,会进行权限校验。 * @param userUuid 成员账号Id */ stopMemberScreenShare: (userUuid: string) => Promise> /** * 尝试关闭房间内成员的系统音频流共享,会进行权限校验 * @param userUuid 成员账号Id */ stopMemberSystemAudioShare: (userUuid: string) => Promise> /** * 尝试关闭成员音频,会进行权限校验 * @param userUuid 成员账号Id */ muteMemberAudio: (userUuid: string) => Promise> /** * 尝试关闭成员视频,会进行权限校验 * @param userUuid 成员账号Id */ muteMemberVideo: (userUuid: string) => Promise> /** * 尝试打开成员音频,会进行权限校验 * @param userUuid 成员账号Id */ unmuteMemberAudio: (userUuid: string) => Promise> /** * 尝试打开成员视频,会进行权限校验 * @param userUuid 成员账号Id */ unmuteMemberVideo: (userUuid: string) => Promise> /** * 订阅指定远端用户辅流视频 * @param userUuid 用户id * @param callback 回调 */ subscribeRemoteVideoSubStream: (userUuid: string) => Promise> // 订阅或取消订阅指定远端用户辅流视频 /** * 取消订阅指定远端用户辅流视频 * @param userUuid 用户id */ unsubscribeRemoteVideoSubStream: (userUuid: string) => Promise> /** * 订阅指定远端用户的视频流 * @param userUuid 用户id * @param streamType 流类型 */ subscribeRemoteVideoStream: ( userUuid: string, streamType: NEVideoStreamType ) => Promise> // 订阅或取消订阅指定远端用户的视频流 /** * 取消订阅指定远端用户的视频流 * @param userUuid 用户id * @param streamType 流类型 */ unsubscribeRemoteVideoStream: ( userUuid: string, streamType: NEVideoStreamType ) => Promise> /** * 设置本端视频流分辨率和帧率 * @param profile */ setLocalVideoConfig: (profile: NERoomVideoConfig) => void /** * @ignore * 设置本端音频流质量 * @param profile */ setLocalAudioProfile: (profile: AudioProfile) => void /** * 设置本端音频流质量 * @param profile */ setAudioProfile: (profile: AudioProfile | number) => void /** * @ignore * 设置本端共享辅流分辨率和帧率 * @param profile */ setLocalScreenProfile: (profile: { resolution: VideoResolution frameRate: VideoFrameRate }) => void /** * @ignore 不对外暴露 */ operateStream: (type: NEMediaTypes, isOpen?: boolean) => Promise /** * @ignore 不对外暴露 */ playLocalStream: (type: NEMediaTypes) => Promise /** * 切换设备 * @param DeviceType 切换设备类型 'camera' | 'microphone' | 'speaker' * @param string 设备id */ switchDevice: (params: { type: DeviceType deviceId: string }) => Promise> /** * 打开本端音频发送 * 该方法用于允许上行本地音频流 */ unmuteMyAudio: (enableMediaPub?: boolean) => Promise> /** * 打开本端视频 */ unmuteMyVideo: ( enableMediaPub?: boolean, facingMode?: 'user' | 'environment' ) => Promise> // eslint-disable-next-line @typescript-eslint/ban-types /** 获取当前已选择麦克风id */ getSelectedRecordDevice: () => string /** 获取当前已选择摄像头id */ getSelectedCameraDevice: () => string /** 获取当前已选择扬声器id */ getSelectedPlayoutDevice: () => string /** 获取当前麦克风列表 */ enumRecordDevices: () => Promise> /** 获取当前摄像头列表 */ enumCameraDevices: () => Promise> /** 获取当前扬声器列表 */ enumPlayoutDevices: () => Promise> /** * 切换麦克风设备 * @param deviceId 设备Id */ setSelectedRecordDevice: ( deviceId: string ) => Promise> /** * 切换摄像头设备 * @param deviceId 设备Id */ setSelectedCameraDevice: ( deviceId: string ) => Promise> /** * 切换扬声器设备 * @param deviceId 设备Id */ setSelectedPlayoutDevice: ( deviceId: string ) => Promise> // todo web不支持 /** * 停止跨房间媒体流转发。 * 主播离开房间时,跨房间媒体流转发自动停止,您也可以在需要的时候随时调用 stopChannelMediaRelay 方法,此时主播会退出所有目标房间 */ // stopChannelMediaRelay: () => Promise> /** * 设置外部视频源数据输入 * @param videoSource 外部视频源 */ pushExternalVideoFrame: (videoSource: MediaStreamTrack) => number /** * 该方法启用或关闭外部视频数据输入功能 需要重新开关视频才能生效 * @param enable 是否开启 */ setExternalVideoSource: (enable: boolean) => number /** * 设置外部视频辅流源数据输入 * @param videoSource 外部视频源 */ pushExternalScreenVideoFrame: (videoSource: MediaStreamTrack) => number /** * 该方法启用或关闭外部视频辅流数据输入功能 需要重新开关视频才能生效 * @param enable 是否开启 */ setEnableExternalScreenVideo: (enable: boolean) => number /** * 开启外部视频源数据输入 * 该方法启用外部视频数据输入功能 需要重新开关视频才能生效 */ // enableExternalVideoSource: () => void /** * 关闭外部视频源数据输入 * 该方法关闭外部视频数据输入功能 需要重新开关视频才能生效 */ // disableExternalVideoSource: () => void /** * 开启耳返功能。 * 开启耳返功能后,必须连接上耳机或耳麦,才能正常使用耳返功能。 */ enableEarBack: () => Promise> /** * 关闭耳返功能。 * 开启耳返功能后,必须连接上耳机或耳麦,才能正常使用耳返功能。 * @param volume 设置耳返音量,可设置为 0~100,默认为 100。 */ disableEarBack: () => Promise> /** * 开始播放音乐文件。 * 该方法指定本地或在线音频文件来和录音设备采集的音频流进行混音。 * 支持的音乐文件类型包括 MP3、M4A、AAC、3GP、WMA 和 WAV 格式,支持本地文件或在线 URL。 * @param option 创建混音任务配置的选项,包括混音任务类型、混音文件全路径或 URL 等,详细信息请参考 audio.NERtcCreateAudioMixingOption。 */ startAudioMixing: ( option: NERoomCreateAudioMixingOption ) => Promise> /** * 播放指定音效文件。 * 该方法播放指定的本地或在线音效文件。 * 支持的音效文件类型包括 MP3、M4A、AAC、3GP、WMA 和 WAV 格式,支持本地 SD 卡中的文件和在线 URL * @param effectId 指定音效的 ID。每个音效均应有唯一的 ID。 * @param option 音效相关参数,包括混音任务类型、混音文件路径等。 */ playEffect: ( effectId: number, option: NERoomCreateAudioEffectOption ) => Promise> /** * 停止播放音乐文件及混音。 * 该方法停止播放伴奏。 */ stopAudioMixing: () => Promise> /** * 停止播放指定音效文件。 * @param effectId 指定音效的 ID。每个音效均有唯一的 ID。 */ stopEffect: (effectId: number) => Promise> /** * 调节伴奏播放音量。 * 该方法调节混音里伴奏的播放音量大小。 * @param volume 伴奏播放音量。取值范围为 0~100。默认 100,即原始文件音量。 */ setAudioMixingPlaybackVolume: (volume: number) => Promise> /** * 设置音效文件发送音量。 * @param volume 音效发送音量。范围为0~100,默认为100,表示原始音量。 */ setEffectSendVolume: (volume: number) => Promise> /** * 停止播放所有音效文件。 */ stopAllEffects: () => Promise> // /** // * 打开本端音频发送 // */ // enableMyAudio: () => Promise> // /** // * 关闭本端音频发送,并关闭设备 // */ // disableMyAudio: () => Promise> // /** // * 打开本端音频发送 // */ // enableMyVideo: () => Promise> // /** // * 关闭本端视频发送,并关闭设备 // */ // disableMyVideo: () => Promise> /** * 重新播放远端流(自动播放受限时) */ replayRemoteStream: (options: { userUuid: string type: NEMediaTypes }) => Promise /** * 调节本端的采集音量 * @param volume */ adjustRecordingSignalVolume: (volume: number) => number /** * 暂停播放指定音效文件 * @param effectId */ pauseEffect: (effectId: number) => Promise> /** * 暂停播放所有音效文件 */ pauseAllEffects: () => Promise> /** * 恢复播放指定音效文件 * @param effectId */ resumeEffect: (effectId: number) => Promise> /** * 恢复播放所有音效文件 */ resumeAllEffects: () => Promise> /** * 获取音效文件时长 * @param effectId */ getEffectDuration: (options: NERtcEffectDuration) => Promise> /** * 设置房间场景 * 该方法必须在加入房间前调用,进入房间后无法再设置房间场景 * @param profile */ setChannelProfile: (options: NERoomRtcChannelProfile) => number /** * 开启音频辅流 */ enableLocalSubStreamAudio: () => Promise> /** * 关闭音频辅流 */ disableLocalSubStreamAudio: () => Promise> /** * 暂停本地麦克风采集,调用后远端用户听不到本端声音。 * 该方法仅修改本地媒体状态,不会改变用户的音频开关状态[NERoomMember.isAudioOn] * */ pauseLocalAudioRecording: () => Promise> /** * 恢复本地麦克风采集,调用后远端用户可以听到本端声音。 * 该方法仅修改本地媒体状态,不会改变成员的音频开关状态[NERoomMember.isAudioOn] */ resumeLocalAudioRecording: () => Promise> /** * 开启/关闭字幕 * @param enable 是否开启 */ enableCaption(enable: boolean): Promise /** * 设置字幕 * 设置字幕翻译语言。默认为 [NERoomCaptionTranslationLanguage.NONE],即不翻译。 * @param language 目标翻译语言 [NERoomCaptionTranslationLanguage] */ setCaptionTranslationLanguage( language: NERoomCaptionTranslationLanguage ): Promise /** * 暂停本地视频采集。 * 该方法仅修改本地媒体状态,不会改变用户的视频开关状态[NERoomMember.isVideoOn] */ pauseLocalVideoCapture: () => Promise> /** * 恢复本地视频采集。 * 该方法仅修改本地媒体状态,不会改变成员的视频开关状态[NERoomMember.isVideoOn] */ resumeLocalVideoCapture: () => Promise> /** * 调节本地播放的所有远端用户的信号音量。 通过此接口可以实现调节所有远端用户在本地播放的混音音量(由于系统限制,ios上目前不支持设置远端音频音量)。 * * @param volume 采集信号音量,取值范围为 [0, 100]。0:静音。100:(默认)原始音量 * @return 0 成功,否则失败 */ adjustPlaybackSignalVolume: (volume: number) => number /** * 开启RTC媒体流自定义加密 * @param libPath 动态库地址,必传;(Windows: .dll; Mac: .dylib; Linux: .so) * @platform Electron * @since v1.39.0 */ enableCustomEncryption?: (libPath: string) => number /** * 开启RTC媒体流加 * @param gmEncryptKey 加密密钥,由业务服务端生成密钥,必传 * @param encryptionMode 加密方式,默认为128 位 SM4 加密,ECB模式sm4-128-ecb。(目前仅支持sm4-128-ecb) */ enableEncryption: ( gmEncryptKey: string, encryptionMode: NEEncryptionMode ) => number takeRemoteSnapshot( userUuid: string, streamType: 0 | 1 ): Promise> takeLocalSnapshot?: ( streamType: 0 | 1 ) => Promise> /** * 开启分享系统音频 * @param stopCurrentShare 是否停止当前其他成员的共享,默认为false */ startShareSystemAudio?: ( stopCurrentShare?: boolean ) => Promise> /** * 停止分享系统音频 */ stopShareSystemAudio?: () => Promise> /** * 添加房间推流任务 * 成功调用该方法后,当前用户可以收到该直播流的状态通知 * (该方法仅适用直播场景,请在房间内调用该方法,该方法在通话中有效。该方法每次只能增加一路旁路推流地址。如需推送多路流,则需多次调用该方法。同一个音视频房间(即同一个 channelid)可以创建 3 个不同的推流任务) * @param taskInfo 推流任务信息 */ addLiveStreamTask: ( taskInfo: NERoomLiveStreamTaskInfo ) => Promise> /** * 更新修改房间推流任务 * 该方法仅适用直播场景 * 请在房间内调用该方法,该方法在通话中有效 * @param taskInfo 推流任务信息 */ updateLiveStreamTask: ( taskInfo: NERoomLiveStreamTaskInfo ) => Promise> /** * 删除房间推流任务 * (该方法仅适用直播场景,请在房间内调用该方法,该方法在通话中有效) * @param taskId 推流任务 ID */ removeLiveStreamTask: (taskId: string) => Promise> /** * 关闭RTC媒体流加 */ disableEncryption: () => number /** *@ignore 内部使用 */ getLocalAudioStats: () => Promise /** *@ignore 内部使用 */ getTransportStats: () => Promise /** *@ignore 内部使用 */ getLocalVideoStats: () => Promise /** *@ignore 内部使用 */ getRemoteAudioStats: () => Promise /** *@ignore 内部使用 */ getRemoteVideoStats: () => Promise /** *@ignore 内部使用 */ getRemoteScreenStats: () => Promise /** *@ignore 内部使用 */ getSessionStats: () => Promise /** *@ignore 内部使用 Electron 接口 */ getPlayoutDeviceMute?: () => boolean /** *@ignore 内部使用 Electron 接口 */ getPlayoutDeviceVolume?: () => number /** *@ignore 内部使用 Electron 接口 */ setPlayoutDeviceVolume?: (value: number) => number /** *@ignore 内部使用 Electron 接口 */ getScreenCaptureSourceList?: () => Promise< NEResult > /** *@ignore 内部使用 Electron 接口 */ setAudioProfileInEle?: (profile: number, scenario: number) => void /** *@ignore 内部使用 Electron 接口 */ enableAudioAINS?: (enable: boolean) => number /** *@ignore 内部使用 Electron 接口 */ enableAudioAINSMode?: (mode: NERoomAudioAINSMode) => number /** *@ignore 内部使用 Electron 接口 */ enableAudioEchoCancellation?: (enable: boolean) => number /** *@ignore 内部使用 Electron 接口 */ setRecordDeviceVolume?: (volume: number) => number /** *@ignore 内部使用 Electron 接口 */ enableAudioVolumeAutoAdjust?: (enable: boolean) => number /** *@ignore 内部使用 Electron 接口 */ startSystemAudioLoopbackCapture?: () => number /** *@ignore 内部使用 Electron 接口 */ stopSystemAudioLoopbackCapture?: () => number /** *@ignore 内部使用 Electron 接口 */ startAudioDump?(type?: number): number /** *@ignore 内部使用 Electron 接口 */ stopAudioDump?(): number /** * @ignore 内部使用 Electron 接口 */ getVirtualBackgroundSupportedType?: () => NERoomVirtualBackgroundSupportedType /** *@ignore 内部使用 Electron 接口 */ enableLocalVideo?: (enable: boolean) => number /** *@ignore 内部使用 Electron 接口(开始本地录制) */ startLocalRecord?: (options: NERoomStartLocalRecordOptions) => number /** *@ignore 内部使用 Electron 接口(结束本地录制) */ stopLocalRecord?: () => number /** *@ignore 内部使用 Electron 接口(更新本地录制布局) */ updateLocalRecordLayouts?: ( options: NERoomUpdateLocalRecordLayoutsOptions[] ) => number /** *@ignore 内部使用 Electron 接口(自定义流输入) */ pushLocalRecorderVideoFrame?: ( uid: string, streamLayer: NERoomStreamLayer, frame: NERoomVideoFrame ) => number /** * 开启AI啸叫检测 */ enableAIhowling?: () => void /** * 关闭AI啸叫检测 */ disableAIhowling?: () => void /** * 开启音频特效 */ enableAudioEffect?: () => Promise /** * 开启虚拟背景 */ enableVirtualBackground: (options: { enable: boolean force?: boolean path?: string blurDegree?: number type: number }) => Promise> /** * 开启美颜 * @param enable 是否开启美颜 * @returns number 0是成功,其他为失败 */ enableBeauty?: (enable: boolean) => Promise> /** * * @param type 美颜效果类型 * @param value 美颜效果值 * @returns number 0是成功,其他为失败 */ setBeautyEffect?: (type: NERoomBeautyEffectType, value: number) => number /** * 关闭美颜 */ disableBeauty?: () => Promise> /** * 设置变声效果 */ setAudioEffect?: ( type: number | string, value: number | Array | ReverbConfig ) => void /** * 关闭音频特效 */ disableAudioEffect?: () => Promise /** * 开启AI降噪 */ enableAIDenoise?: () => Promise /** * 设置背景人声消除阈值 */ setVoiceGate?: (level: number) => void /** * 关闭AI降噪 */ disableAIDenoise?: () => Promise /** * 开启/关闭云代理服务。 * @param transportType 云代理类型。参考 [NERoomRtcTransportType] */ setCloudProxy(transportType: NERoomRtcTransportType): number /** * 设置音视频通话的相关参数 * @note 该方法用于通过 JSON 配置 SDK 提供技术预览或特别定制功能。以标准化方式公开 JSON 选项。 * @param params 音视频通话的相关参数,JSON 字符串形式。 * @return number 0是成功,其他为失败 */ setParameters?(params: string): number /** *@ignore 内部使用 Electron 接口(本地录制:停止转码) */ stopLocalRecorderRemux?: () => number /** *@ignore 内部使用 Electron 接口,设置本地视频帧率 */ setLocalVideoFramerate?: (framerate: number) => number /** *@ignore 内部使用 Electron 接口,设置视频流模式 */ setVideoStreamLayerCount?: (layerCount: 1 | 2 | 3) => number /** * @ignore 不对外暴露 */ destroy: () => Promise> /** * 开始跨房间媒体流转发 web 端支持 * @param roomUuid 目标房间的 uuid * @returns */ startChannelMediaRelay?: (roomUuid: string) => Promise> /** * 停止跨房间媒体流转发 web 端支持 * @returns */ stopChannelMediaRelay?: (roomUuid: string) => Promise> /** * 设置音频场景 * @param scenario 音频场景 */ setAudioScenario?: (scenario: NERoomAudioScenarioType) => number /** * 设置字幕翻译配置 * @param config 目标翻译配置 [NERoomCaptionTranslationConfig] * * 注意事项:区别于 [setCaptionTranslationLanguage],该接口可配置多源语言和多目标语言,且支持的语言更丰富。 */ setCaptionTranslationConfig: ( config: NERoomCaptionTranslationConfig ) => Promise /** * 获取本地系统时间与服务端时间差值 */ getNtpTimeOffset: () => number /** * 根据 rtcUid 订阅/取消订阅视频流 * @param rtcUid rtcUid * @param streamType 订阅大小流 * @param subscribe 是否订阅 */ subscribeRemoteVideoStreamByRtcUid: ( rtcUid: number, streamType: NEVideoStreamType, subscribe: boolean ) => Promise> /** * 根据 rtcUid 订阅/取消订阅辅流视频 * @param rtcUid rtcUid * @param subscribe 是否订阅 */ subscribeRemoteVideoSubStreamByRtcUid: ( rtcUid: number, subscribe: boolean ) => Promise> /** * 根据rtcUid设置远端用户画布 * @param rtcUid rtcUid * @param videoView 视频画布 */ setupRemoteVideoCanvasByRtcUid: ( rtcUid: number, videoView: NERoomVideoView ) => Promise> /** * 根据rtcUid设置远端用户辅流画布 * @param rtcUid rtcUid * @param videoView 视频画布 */ setupRemoteVideoSubStreamCanvasByRtcUid: ( rtcUid: number, videoView: NERoomVideoView ) => Promise> /** * 获取麦克风音量 * @return number 音量大小,取值范围为 [0, 100] 0:静音。100:(默认)原始音量。 */ getRecordDeviceVolume?: () => number /** * 开启视频低光增强 * @param enable 是否开启视频低光增强 * @param level 视频低光增强级别 * @return number 0是成功,其他为失败 */ enableVideoLowlightEnhance?: ( enable: boolean, level: NERoomVideoLowlightEnhanceLevel ) => number } export type NERoomCaptionTranslationConfig = { /** * 字幕翻译语言,默认为空,不翻译 * * 【源语言支持–常见语言】ar-阿拉伯语;de-德语;en-英语;es-西班牙语;fr-法语;hi-印地语;id-印度尼西亚语;it-意大利语; ja-日语;ko-韩语;nl-荷兰语;pt-葡萄牙语;ru-俄语;th-泰语;vi-越南语;zh-简体中文; * 【源语言支持–汉语方言】 db-东北话;nan-闽南语;sc-四川话;yue-粤语;zj-浙江话; * 【源语言支持–非常见语言】 bn-孟加拉语;fa-波斯语;he-希伯来语;km-高棉语;lo-老挝语;ms-马来语;tl-菲律宾语;tr-土耳其语; */ srcLanguage?: string /** * 字幕的多源语言,默认为空。 * * 【源语言支持–常见语言】ar-阿拉伯语;de-德语;en-英语;es-西班牙语;fr-法语;hi-印地语;id-印度尼西亚语;it-意大利语; ja-日语;ko-韩语;nl-荷兰语;pt-葡萄牙语;ru-俄语;th-泰语;vi-越南语;zh-简体中文; * 【源语言支持–汉语方言】 db-东北话;nan-闽南语;sc-四川话;yue-粤语;zj-浙江话; * 【源语言支持–非常见语言】 bn-孟加拉语;fa-波斯语;he-希伯来语;km-高棉语;lo-老挝语;ms-马来语;tl-菲律宾语;tr-土耳其语; */ srcLanguageArr: string[] /** * 字幕的目标语言。默认为空,不翻译。 * * 【目标语言支持–常见语言】 ar-阿拉伯语;de-德语;en-英语;es-西班牙语;fr-法语;hi-印地语;id-印度尼西亚语;it-意大利语; ja-日语;ko-韩语;nl-荷兰语;pt-葡萄牙语;ru-俄语;th-泰语;vi-越南语;zh-简体中文; * 【目标语言支持–非常见语言】 bn-孟加拉语;fa-波斯语;he-希伯来语;km-高棉语;lo-老挝语;ms-马来语;tl-菲律宾语;tr-土耳其语; */ dstLanguageArr: string[] /** * 是否抄送同语言的翻译消息。默认为 false。 */ needTranslateSameLanguage?: boolean } export enum NERoomAudioScenarioType { /** * @if English * 0: Default settings. * - kNERtcAudioScenarioSpeech in kNERtcChannelProfileCommunication. * - kNERtcAudioScenarioMusic in kNERtcChannelProfileLiveBroadcasting. * @endif * @if Chinese * 0: 默认设置 * - kNERtcChannelProfileCommunication 下为 kNERtcAudioScenarioSpeech, * - kNERtcChannelProfileLiveBroadcasting 下为 kNERtcAudioScenarioMusic。 * @endif */ kNERtcAudioScenarioDefault = 0, /** * @if English * 1: Voice scenarios. Set NERtcAudioProfileType to kNERtcAudioProfileMiddleQuality or lower. * @endif * @if Chinese * 1: 语音场景. NERtcAudioProfileType 推荐使用 kNERtcAudioProfileMiddleQuality 及以下 * @endif */ kNERtcAudioScenarioSpeech = 1, /** * @if English * 2: Music scenarios. Set NERtcAudioProfileType to kNERtcAudioProfileMiddleQualityStereo or above. * @endif * @if Chinese * 2: 音乐场景。NERtcAudioProfileType 推荐使用 kNERtcAudioProfileMiddleQualityStereo 及以上 * @endif */ kNERtcAudioScenarioMusic = 2, } export enum NERoomCaptionTranslationLanguage { /** * 不翻译 */ NONE = 0, /** * 中文 */ CHINESE = 1, /** * 英文 */ ENGLISH = 2, /** * 日文 */ JAPANESE = 3, } export interface NERtcEffectDuration { filePath: string effectId: number cycle: number } export interface NERoomRtcChannelProfile { mode: 'rtc' | 'live' }