/// import { EventEmitter } from "events"; import { RenderOptions, RenderType, VirtualBackgroundSource, EffectBeautyMode, AudioMixingDualMonoMode, RTCWatermarkConfig, ProblemFeedbackOption, Rectangle, ScreenCaptureSourceInfo, ScreenCaptureSourceType, ThumbnailInfo, AppIconInfo, MessageConfig, StreamIndex, AlphaLayout, RemoteStreamKey, RemoteUserPriority, EchoTestConfig, AudioMixingConfig, MouseCursorCaptureState, ScreenCaptureParameters, HighlightConfig, RecordingConfig, ITranscoderParam, PushSingleStreamParam, VideoEncoderConfig, VideoCaptureConfig, MirrorType, IPublicStreamParam, RecordingType, AudioPropertiesConfig, AudioTrackType, AudioPlayType, DownloadLyricType, SEICountPerFrame, ScreenVideoEncoderConfig, AnsMode, VideoSuperResolutionMode, AudioChannel, CloudProxyInfo, StreamSycnInfoConfig, SingScoringConfig, StandardPitchInfo, VoiceEqualizationConfig, VoiceReverbConfig, AudioRecordingConfig, VideoRotation, ZoomConfigType, ZoomDirectionType, LocalProxyConfiguration, IMixedStreamConfig, ProblemFeedbackInfo, LogConfig, EarMonitorMode, AudioFrameCallbackMethod, AudioFormat, AudioAlignmentMode, PixelFormat, VideoSourceType, ExternalVideoFrame, AudioSourceType, ExternalAudioFrame, VideoEnhancementMode } from "../types"; import { UserRenderInfo, RTCVIDEOCALLBACK, RTCPlugin, RTCPluginInfo } from "../types/common"; import veRTCRoom from "./room"; import veRTCAudioEffectPlayer from "./audio_effect_player"; import veRTCMediaPlayer from "./media_player"; /** {en} * @list overview * @detail api */ /** {zh} * @list overview * @detail api */ declare class RTCVideo extends EventEmitter { private instance; private publicStreamViews; private mixingTaskViews; private plugins; private previewUser; private preRemoteUsers; private audioEffectPlayerIns; constructor(); /** {en} * @brief Create an engine instance. * @param app_id A unique identifier for each App, randomly generated by the RTC console. Only instances created with the same app_id are able to communicate with each other. * @param parameters Reserved parameters. Please contact technical support fellow if needed. * @returns + `0`: Success * + `-1`: Failure * @notes + This is the very first API that you must call if you want to use all the RTC capabilities. * + If there is no engine instance in current thread, calling this API will create one. If an engine instance has been created, calling this API again will have the created engine instance returned. * @group Engine Management * @order 0 */ /** {zh} * @brief 创建引擎对象 * @param app_id 每个应用的唯一标识符,由 RTC 控制台随机生成的。不同的 AppId 生成的实例在 RTC 中进行音视频通话完全独立,无法互通。 获取到当前应用的目录路径。 * @param parameters 私有参数。如需使用请联系技术支持人员。 * @returns + `0`: 成功 * + `-1`: 失败 * @notes + 你应注意保持 handler 的生命周期必须大于 `RTCVideo` 的生命周期,即 handler 必须在调用 [createRTCVideo](#creatertcvideo) 之前创建,在调用 [destroyRTCVideo](#destroyrtcvideo) 之后销毁。 * + 通常不建议在移动端设备上创建多于 2 个引擎实例。 * + 如果当前线程中未创建引擎实例,那么你必须先使用此方法,以使用 RTC 提供的各种音视频能力。 * + 如果当前线程中已创建了引擎实例,再次调用此方法时,会返回已创建的引擎实例。 * @group Engine Management * @order 0 */ createRTCVideo(app_id: string, parameters: string): number; /** {en} * @brief Create a room for the call * @param room_id roomId is an non-empty string within 128 bytes. Each room created by calling this API requires a unique roomid. So that the room can be distinguished from each other. * The following character sets are supported: * + 26 uppercase letters A~ Z * + 26 lowercase letters a~ z * + 10 numbers: 0~ 9 * + Underscore "_", at sign "@" , and minus sign "-" * Do not create multiple rooms with the same roomId, otherwise the newly created room instance will replace the old one. * @returns + `0`: Success * + `-1`: Failure * @notes + Each call of this API creates one `veRTCRoom` instance. Call this API as many times as the number of rooms you need. And then call [joinRoom](#joinroom) of each `IRTCRoom` instance to join multiple rooms at the same time. These enable Multi-room mode. In Multi-room mode, a user can subscribe to media streams in the joined rooms at the same time. * + To forward streams to the other rooms, call [startForwardStreamToRooms](#startforwardstreamtorooms) instead of enabling Multi-room mode. * @group Room Management * @order 0 */ /** {zh} * @brief 创建房间 * @param room_id 标识通话房间的房间 ID,最大长度为 128 字节的非空字符串。支持的字符集范围为: * • 26个大写字母 A ~ Z * • 26个小写字母 a ~ z * • 10个数字 0 ~ 9 * • 下划线 "_", at 符 "@", 减号 "-" * 请勿使用同样的 roomId 创建多个房间,否则后创建的房间实例会替换先创建的房间实例。 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 多次调用此方法以创建多个 `veRTCRoom` 实例。分别调用各实例中的 joinRoom 方法,同时加入多个房间。多房间模式下,用户可以同时订阅各房间的音视频流。 * @group Room Management * @order 0 */ createRTCRoom(room_id: string): veRTCRoom; /** {en} * @brief Destroy the engine instance created by `createRTCVideo`, and release all related resources. * @returns + `0`: Success * + `-1`: Failure * @notes + Call this API after all business scenarios related to the engine instance are destroyed. In a multi-thread scenario, you must not call `RTCVideo` related APIs after calling this interface, or the SDK may crash. When the API is called, RTC SDK destroys all memory associated with the engine instance and stops any interaction with the media server. * + Calling this API will start the SDK exit logic. The engine thread is held until the exit logic is complete. The engine thread is retained until the exit logic is complete. Therefore, do not call this API directly in the callback thread, or wait for the execution of the main thread in the callback and call this API in the main thread at the same time. Otherwise, it will cause a deadlock. * @group Engine Management * @order 1 */ /** {zh} * @region 引擎管理 * @brief 销毁引擎实例对象 * @returns + `0`: 成功 * + `-1`: 失败 * @notes + 请确保和需要销毁的 `RTCVideo` 实例相关的业务场景全部结束后,才调用此方法 * + 该方法在调用之后,会销毁所有和此 `RTCVideo` 实例相关的内存,并且停止与媒体服务器的任何交互 * + 调用本方法会启动 SDK 退出逻辑。引擎线程会保留,直到退出逻辑完成。因此,不要在回调线程中直接调用此 API,会导致死锁。同时此方法是耗时操作,不建议在主线程调用本方法,避免主线程阻塞。 * @group Engine Management * @order 1 */ destroyRTCVideo(): number; /** {en} * @brief Get the current SDK version information. * @returns Current SDK version information. * @group Engine Management * @order 3 */ /** {zh} * @brief 获取当前 SDK 版本信息 * @returns 当前 SDK 版本信息 * @group Engine Management * @order 3 */ static getSDKVersion(): string; /** {en} * @brief Configure the logs. * @param log_config Log configuration * @returns + `0`: Success * + `-1`: Failure * @group Engine Management * @order 5 */ /** {zh} * @brief 设置日志文件 * @param log_config 日志文件配置 * @returns + `0`: 成功 * + `-1`: 失败 * @group Engine Management * @order 5 */ static setLogConfig(log_config: LogConfig): number; /** {en} * @brief Get the description of the error code * @param code Needs to get the description of the error code * @returns The description of the error code * @notes This interface is a general function and does not need to rely on the engine object when calling. * @group Engine Management * @order 8 */ /** {zh} * @brief 获取错误码的描述 * @param code 需要获取描述的错误码 * @returns 错误码的描述 * @notes 该接口是通用功能,调用时不需要依赖引擎对象。 * @group Engine Management * @order 8 */ static getErrorDescription(code: number): string; /** {en} * @brief Get process ID of the engine for commissioning * @returns Process ID * @group Engine Management * @order 12 */ /** {zh} * @brief 获取加载引擎进程的 ID 方便调试 * @returns 进程的 ID * @group Engine Management * @order 12 */ static getCurrentProcessId(): string; /** {en} * @brief set render type * @param type render type * @notes * + The default rendering type is WebGL rendering. * + Set WebGL rendering,if WebGL rendering is not supported or WebGL rendering fails, it will automatically switch to Software rendering. * + After setting the rendering type, the newly created canvas rendering type will take effect in the new rendering mode. * @group Engine Management * @order 2 */ /** {zh} * @brief 设置渲染类型 * @param type 渲染类型 * @notes * + 默认渲染类型为 WebGL 渲染。 * + 设置渲染类型之后,新创建的 canvas 渲染类型会以新的渲染方式生效 * + 设置 WebGL 渲染,如果不支持 WebGL 渲染或者 WebGL渲染失败的情况下,会自动切换为 Software 渲染。 * @group Engine Management * @order 2 */ static setRenderType(type: RenderType): void; /** {en} * @brief Report the user feedback to RTC. * @param type List of preset problems. * @param info Specific description of other problems other than the preset problem. * @returns + 0: Report successfully * + -1: Failed to report, not yet joined the room * + -2: Failed to report, data analysis error * + -3: Failed to report, missing fields * @notes + If the user is in the room when reporting, the report leads to the room / rooms where the user is currently located; * + If the user is not in the room when reporting, the report leads to the previously exited Room. * @group Engine Management * @order 4 */ /** {zh} * @brief 将用户反馈的问题上报到 RTC * @param type 反馈问题类型。 * @param info 预设问题以外的其他问题的具体描述,房间信息。 * @returns + 0: 上报成功 * + -1: 上报失败,还没加入过房间 * + -2: 上报失败,数据解析错误 * + -3: 上报失败,字段缺失 * @notes + 你可以在 [RTC 控制台](https://console.volcengine.com/rtc/callQualityRTC/feedback)上查看用户通过此接口提交的反馈详情和整体趋势。 * + 如果用户上报时在房间内,那么问题会定位到用户当前所在的一个或多个房间;如果用户上报时不在房间内,那么问题会定位到引擎此前退出的房间。 * @group Engine Management * @order 4 */ feedback(type: ProblemFeedbackOption, info: ProblemFeedbackInfo): number; /** {en} * @brief Sets the business ID * @param business_id Your customized businessId * BusinessId is a tag, and you can customize its granularity. * @returns + 0: Success * + < 0: Failure. * + -2: Invalid value. * @notes + You can use businessId to distinguish different business scenarios. You can customize your businessId to serve as a sub AppId, which can share and refine the function of the AppId, but it does not need authentication. * + You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid. * @group Engine Management * @order 6 */ /** {zh} * @region 引擎管理 * @brief 设置业务标识参数 * @param business_id 用户设置的自己的 business_id 值。business_id 相当于一个 sub AppId,可以分担和细化现在 AppId 的逻辑划分的功能, 但不需要鉴权。business_id 只是一个标签,颗粒度需要用户自定义。 * @returns + 0: 成功。 * + <0: 失败 * + -2: 参数非法。 * @notes 可通过 businessId 区分不同的业务场景。businessId 由客户自定义,相当于一个“标签”,可以分担和细化现在 AppId 的逻辑划分的功能,但不需要鉴权。 * @group Engine Management * @order 6 */ setBusinessId(business_id: string): number; /** {en} * @private * @brief Set runtime parameters. * @param json_string JSON string * @returns + 0: Success * + < 0: Failure. * @group Engine Management * @order 7 */ /** {zh} * @private * @region 引擎管理 * @brief 设置运行时的参数 * @param json_string json 序列化之后的字符串,用以覆盖全局参数。 * @returns + `0`: 成功 * + `-1`: 失败 * @group Engine Management * @order 7 */ setRuntimeParameters(json_string: string): number; /** {en} * @brief Set the way to use built-in encryption when transmitting * @param encrypt_type Built-in encryption algorithm. * @param key Encryption key, the length is limited to 36 bits, and the excess will be Truncate * @returns + 0: Success * + < 0: Failure. * @notes + Use this method when using the built-in encryption on transfer; if you need to use custom encryption on transfer. Built-in encryption and custom encryption are mutually exclusive, and the transmission is determined to be encrypted according to the last method called. * + This method must be called before entering the room, and can be called repeatedly, taking the last called parameter as the effective parameter. * @group Security and Encryption * @order 5 */ /** {zh} * @region 加密 * @brief 设置传输时使用内置加密的方式 * @param encrypt_type 加密算法
  • `0`: 不使用内置加密
  • `1`:AES-128-CBC 加密算法
  • `2`:AES-256-CBC 加密算法
  • `3`:AES-128-ECB 加密算法
  • `4`:AES-256-ECB 加密算法
  • * @param key 加密密钥,长度限制为 36 位,超出部分将会被截断 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 该方法必须在进房之前调用,可重复调用,以最后调用的参数作为生效参数。 * @group Security and Encryption * @order 5 */ setEncryptInfo(encrypt_type: number, key: string): number; /** {en} * @region Plugin management * @brief Initialize the plugin manager * @returns + `0`: Success * + `-1`: Failure * @notes This method must be called after creating the engine and before entering the room. * @group Plugin Manager * @order 0 */ /** {zh} * @region 插件管理 * @brief 初始化插件管理器 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 该方法必须在创建引擎之后,进房之前调用。 * @group Plugin Manager * @order 0 */ initializePluginManager(): number; /** {en} * @region Plugin management * @brief Release plugin manager * @returns + `0`: Success * + `-1`: Failure * @notes This method must be called after the plugin manager is initialized and before the engine is destroyed. * @group Plugin Manager * @order 5 */ /** {zh} * @region 插件管理 * @brief 释放插件管理器 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 该方法必须在初始化插件管理器之后,销毁引擎之前调用。 * @group Plugin Manager * @order 5 */ releasePluginManager(): number; /** {en} * @region Plugin management * @brief Register plugin * @param info #RTCPluginInfo type: id is the unique identifier of the plugin, path is the path of the plugin library * @returns + `0`: Success * + `-1`: Failure * @notes This method must be called after the plugin manager has been initialized. * @group Plugin Manager * @order 1 */ /** {zh} * @region 插件管理 * @brief 注册插件 * @param info #RTCPluginInfo类型:id是插件的唯一标识,path是插件库的路径 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 该方法必须在初始化插件管理器之后调用。 * @group Plugin Manager * @order 1 */ registerPlugin(info: RTCPluginInfo): number; /** {en} * @region Plugin management * @brief Get plugin instance * @param plugin_id is the unique identifier for the plugin * @returns #RTCPlugin type, if the plugin does not exist, return undefined * @notes This method must be called after registering the plugin. * @group Plugin Manager * @order 2 */ /** {zh} * @region 插件管理 * @brief 获取插件实例 * @param plugin_id 是插件的唯一标识 * @returns #RTCPlugin类型,如果插件不存在返回undefined * @notes 该方法必须在注册插件之后调用。 * @group Plugin Manager * @order 2 */ getPlugin(plugin_id: string): RTCPlugin | undefined; /** {en} * @region Plugin management * @brief Uninstall plugin * @param plugin_id is the unique identifier for the plugin * @returns + `0`: Success * + `-1`: Failure * @notes This method must be called after registering the plugin. * @group Plugin Manager * @order 4 */ /** {zh} * @region 插件管理 * @brief 卸载插件 * @param plugin_id 是插件的唯一标识 * @returns + `0`: 成功 * + `-1`: 失败 * @notes 该方法必须在注册插件之后调用。 * @group Plugin Manager * @order 4 */ unregisterPlugin(plugin_id: string): number; /** {en} * @region Volume management * @brief Set whether to mute the recording signal (without changing the local hardware). * @param index Stream index, specifying the main stream or screen stream volume adjustment. * `1`: Mainstream, which is audio captured by the the microphone using internal capturing; * `0`: Audio streams for screen sharing. * @param mute Whether to mute audio capture. * + True: Mute (disable microphone) * + False: (Default) Enable microphone * @return + 0: Success. * + < 0 : Failure. * @notes + Calling this API does not affect the status of SDK audio stream publishing. * + Adjusting the volume by calling [`setCaptureVolume`](docs-85532#rtcvideo-setcapturevolume) after muting will not cancel the mute state. The volume state will be retained until unmuted. * + You can use this interface to set the capture volume before or after calling [`startAudioCapture`](docs-85532#rtcvideo-startaudiocapture) to enable audio capture. * @group Audio Management * @order 32 */ /** {zh} * @region 音量管理 * @brief 设置是否将录音信号静音(不改变本端硬件)。 * @param index 流索引,指定调节主流/屏幕流音量。 * + `0`: 主流。由麦克风通过内部采集机制,采集到的音频; * + `1`: 屏幕流。来自声卡的本地播放音频流。 * @param mute 是否静音音频采集。 * + True:静音(关闭麦克风) * + False:(默认)开启麦克风 * @return + 0: 调用成功。 * + < 0 : 调用失败。 * @notes + 该方法支持选择静音或取消静音麦克风采集,而不影响 SDK 音频流发布状态。 * + 静音后通过 [`setCaptureVolume`](85532#rtcvideo-setcapturevolume) 调整音量不会取消静音状态,音量状态会保存至取消静音。 * + 调用 [`startAudioCapture`](85532#rtcvideo-startaudiocapture) 开启音频采集前后,都可以使用此接口设置采集音量。 * @group Audio Management * @order 32 */ muteAudioCapture(index: number, mute: boolean): number; /** {en} * @brief Start internal audio capture. The default is off. * @returns + 0: Success * + < 0: Failure. * @notes + The local client will be informed via onAudioDeviceStateChanged after starting audio capture by calling this API. * + To enable a microphone without the user's permission will trigger onWarning. * + Call stopAudioCapture to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. * + To mute and unmute microphones, we recommend using publishStream and unpublishStream, other than stopAudioCapture and this API. Because starting and stopping capture devices often need some time waiting for the response of the device, that may lead to a short silence during the communication. * + Once you create the engine instance, you can start internal audio capture regardless of the audio publishing state. The audio stream will start publishing only after the audio capture starts. * @group Audio Management * @order 69 */ /** {zh} * @region 音频管理 * @brief 开启内部音频采集。默认为关闭状态。 * @returns + 0:成功 * + !0:失败 * @notes + 进房前调用该方法,本地用户会收到 [onAudioDeviceStateChanged](85533#onaudiodevicestatechanged) 的回调。 * + 若未取得当前设备的麦克风权限,调用该方法后会触发 [onAudioDeviceStateChanged](85533#onaudiodevicestatechanged) 回调,对应的 `device_error` 为 1。 * + 调用 stopAudioCapture 可以关闭音频采集设备,否则,SDK 只会在销毁引擎的时候自动关闭设备。 * + 由于不同硬件设备初始化响应时间不同,频繁调用 stopAudioCapture 和本接口闭麦/开麦可能出现短暂无声问题,建议使用 publishStream/unpublishStream 实现临时闭麦和重新开麦。 * + 创建引擎后,无论是否发布音频数据,你都可以调用该方法开启音频采集,并且调用后方可发布音频。 * @group Audio Management * @order 69 */ startAudioCapture(): number; /** {en} * @brief Stop internal audio capture. The default is off. * @returns + 0: Success * + < 0: Failure. * @notes + The local client will be informed via onAudioDeviceStateChanged after stopping audio capture by calling this API. * + The remote clients in the room will be informed of the state change via onUserStopAudioCapture after the visible client stops audio capture by calling this API. * + Call startAudioCapture to enable the internal audio capture. * + Without calling this API the internal audio capture will sustain until you destroy the engine instance. * @group Audio Management * @order 71 */ /** {zh} * @region 音频管理 * @brief 关闭内部音频采集。默认为关闭状态。 * @return * + 0:成功 * + !0:失败 * @notes + 进房前调用该方法,本地用户会收到 [onAudioDeviceStateChanged](85533#onaudiodevicestatechanged) 的回调。 * + 可见用户进房后调用该方法后,房间中的其他用户会收到 [onUserStopAudioCapture](85533#onuserstopaudiocapture) 的回调。 * + 调用 [startAudioCapture](85532#startaudiocapture) 可以开启音频采集设备。 * + 如果不调用本方法停止内部视频采集,则只有当销毁引擎实例时,内部音频采集才会停止。 * @group Audio Management * @order 71 */ stopAudioCapture(): number; /** {en} * @brief Get a list of the audio playback device. When the audio playback device changes, you will receive the `onAudioDeviceStateChanged`, and you need to call this API again to get the new device list. * @returns A list of all audio playback devices * @group Audio Management * @order 3 */ /** {zh} * @region 音频设备管理 * @brief 获取当前系统内音频播放设备列表。如果后续设备有变更,你会收到 [`onAudioDeviceStateChanged`](85533#rtcvideocallback-onaudiodevicestatechanged) 回调通知,然后需要重新调用本接口以获得新的设备列表。 * @returns 包含系统中所有音频播放设备的列表和相关信息 * @group Audio Management * @order 3 */ enumerateAudioPlaybackDevices(): { device_name: string; device_id: string; }[]; /** {en} * @brief Get a list of audio acquisition devices in the current system. If there are subsequent device changes, you need to call this interface again to get a new device list. * @returns An object that contains a list of all audio capture devices in the system. * @group Audio Management * @order 5 */ /** {zh} * @region 音频设备管理 * @brief 获取当前系统内音频采集设备列表。如果后续设备有变更,你需要重新调用本接口以获得新的设备列表。 * @returns 包含系统中所有音频采集设备列表和相关信息 * @group Audio Management * @order 5 */ enumerateAudioCaptureDevices(): { device_name: string; device_id: string; }[]; /** {en} * @brief Sets the audio playback device. * @param device_id Audio playback device's ID. You can get the ID by calling enumerateAudioPlaybackDevices * @returns + 0: Success * + < 0: Failure. * @notes After you call followSystemPlaybackDevice to set the audio playback device to follow the system setting, you cannot call this API to set the audio playback device. * @group Audio Management * @order 7 */ /** {zh} * @region 音频设备管理 * @brief 设置音频播放设备。 * @param device_id 音频播放设备 ID,可通过 [enumerateAudioPlaybackDevices](#enumerateaudioplaybackdevices) 获取。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes 当你调用 followSystemPlaybackDevice 设置音频播放设备跟随系统后,将无法调用此接口设置音频播放设备。 * @group Audio Management * @order 7 */ setAudioPlaybackDevice(device_id: string): number; /** {en} * @brief Set up audio capture devices * @param device_id Audio capture device ID, available through enumerateAudioCaptureDevices * @returns + 0: Success * + < 0: Failure. * @notes After you call followSystemCaptureDevice to set the audio playback device to follow the system setting, you cannot call this API to set the audio capture device. * @group Audio Management * @order 9 */ /** {zh} * @region 音频设备管理 * @brief 设置音频采集设备。 * @param device_id 音频采集设备 ID,可通过 [enumerateAudioPlaybackDevices](#enumerateaudioplaybackdevices) 获取。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes 当你调用 followSystemCaptureDevice 设置音频采集设备跟随系统后,将无法调用此接口设置音频采集设备。 * @group Audio Management * @order 9 */ setAudioCaptureDevice(device_id: string): number; /** {en} * @brief Gets the current audio playback device ID. * @returns Audio playback device ID * @group Audio Management * @order 11 */ /** {zh} * @region 音频设备管理 * @brief 获取当前音频播放设备 ID。 * @returns 当前音频播放设备 ID * @group Audio Management * @order 11 */ getAudioPlaybackDevice(): string; /** {en} * @brief Gets the current audio capture device ID. * @returns Audio capture device ID * @group Audio Management * @order 13 */ /** {zh} * @brief 获取当前音频采集设备 ID。 * @returns 当前音频采集设备 ID * @group Audio Management * @order 13 */ getAudioCaptureDevice(): string; /** {en} * @brief Set the current audio playback device volume * @param volume Audio playback device volume, the value range is [0,255], the setting beyond this range is invalid. * + [0,25] Is nearly silent; * + [25,75] Is low volume; * + [76,204] Is medium volume; * + [205,255] Is high volume. * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 29 */ /** {zh} * @region 音频设备管理 * @brief 设置当前音频播放设备音量 * @param volume 音频播放设备音量,取值范围为 [0,255], 超出此范围设置无效。 * + [0,25] 接近无声; * + [25,75] 为低音量; * + [76,204] 为中音量; * + [205,255] 为高音量。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @group Audio Management * @order 29 */ setAudioPlaybackDeviceVolume(volume: number): number; /** {en} * @brief Get the current audio playback device volume. * @returns Audio playback device volume, the range should be within [0,255]. * + [0,25] Is nearly silent; * + [25,75] Is low volume; * + [76,204] Is medium volume; * + [205,255] Is high volume. * @group Audio Management * @order 31 */ /** {zh} * @brief 获取当前音频播放设备音量 * @returns 音频播放设备音量,范围应在 [0,255] 内。 * + [0,25] 接近无声; * + [25,75] 为低音量; * + [76,204] 为中音量; * + [205,255] 为高音量。 * @group Audio Management * @order 31 */ getAudioPlaybackDeviceVolume(): number; /** {en} * @brief Set the current audio capture volume * @param volume Audio capture volume, the value range is [0,255], the setting beyond this range is invalid. * + [0,25] Is nearly silent; * + [25,75] Is low volume; * + [76,204] Is medium volume; * + [205,255] Is high volume. * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 33 */ /** {zh} * @region 音频设备管理 * @brief 设置当前音频采集设备音量 * @param volume 音频采集设备音量,取值范围为 [0,255], 超出此范围设置无效。 * + [0,25] 接近无声; * + [25,75] 为低音量; * + [76,204] 为中音量; * + [205,255] 为高音量。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes 如果音频采集设备通过 [`setAudioCaptureDeviceMute`](85532#rtcvideo-setaudiocapturedevicemute) 被静音,则音量调节会在取消静音后生效。 * @group Audio Management * @order 33 */ setAudioCaptureDeviceVolume(volume: number): number; /** {en} * @brief Get the current audio capture volume * @returns Audio capture volume, the range is within [0,255]. * + [0,25] Is nearly silent; * + [25,75] Is low volume; * + [76,204] Is medium volume; * + [205,255] Is high volume. * @group Audio Management * @order 35 */ /** {zh} * @region 音频设备管理 * @brief 获取当前音频采集设备音量 * @returns 范围应在 [0,255] 内。 * + [0,25] 接近无声; * + [25,75] 为低音量; * + [76,204] 为中音量; * + [205,255] 为高音量。 * @group Audio Management * @order 35 */ getAudioCaptureDeviceVolume(): number; /** {en} * @brief Mute or Unmute the current audio playback device. The default state is speaking. * @param mute + true: mute * + false: non-mute * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 37 */ /** {zh} * @region 音频设备管理 * @brief 设置当前音频播放设备静音状态,默认为非静音。 * @param mute
  • true:静音
  • false:非静音
  • * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @group Audio Management * @order 37 */ setAudioPlaybackDeviceMute(mute: boolean): number; /** {en} * @brief Get state of the audio playback device. * @returns + true: Mute * + false: Speaking * @group Audio Management * @order 39 */ /** {zh} * @region 音频设备管理 * @brief 获取当前音频播放设备是否静音的信息。 * @returns
  • true:静音
  • false:非静音
  • * @group Audio Management * @order 39 */ getAudioPlaybackDeviceMute(): boolean; /** {en} * @brief Mute or Unmute the current audio capture device. The default state is speaking. * @param mute + true: Mute * + false: Speaking * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 41 */ /** {zh} * @region 音频设备管理 * @brief 设置当前音频采集设备静音状态,默认为非静音。 * @param mute
  • true:静音
  • false:非静音
  • * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @group Audio Management * @order 41 * @notes + 该方法用于静音整个系统的音频采集。 * + 设该方法为 `true` 静音后仍可通过 [`setAudioCaptureDeviceVolume`](85532#rtcvideo-setaudiocapturedevicevolume) 调整采集音量,调整后的音量会在取消静音后生效。 */ setAudioCaptureDeviceMute(mute: boolean): number; /** {en} * @brief Get state of the audio capture device. * @returns + true: Mute * + false: Speaking * @group Audio Management * @order 43 */ /** {zh} * @region 音频设备管理 * @brief 获取当前音频采集设备是否静音的信息。 * @returns + true:静音 * + false:非静音 * @group Audio Management * @order 43 */ getAudioCaptureDeviceMute(): boolean; /** {en} * @brief Adjust the audio capture volume. * @param index Index of the stream, whose volume needs to be adjusted. * @param volume Ratio of capture volume to original volume. * This changes the volume property of the audio data other than the hardware volume. * Ranging: [0,400]. Unit: % * + 0: Mute * + 100: Original volume. To ensure the audio quality, we recommend [0, 100]. * + 400: Four times the original volume with signal-clipping protection. * @returns + 0: Success * + < 0: Failure. * @notes Call this API to set the volume of the audio capture before or during the audio capture. * @group Audio Management * @order 55 */ /** {zh} * @region 音量管理 * @brief 调节音频采集音量 * @param index 流索引,指定调节主流还是调节屏幕流的音量
  • 主流。包括:由摄像头/麦克风通过内部采集机制,采集到的视频/音频。
  • 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
  • * @param volume 采集的音量值和原始音量的比值,范围是 [0, 400],单位为 %,自带溢出保护。 * 只改变音频数据的音量信息,不涉及本端硬件的音量调节。 * 为保证更好的通话质量,建议将 volume 值设为 [0,100]。 * + 0:静音 * + 100:原始音量 * + 400: 最大可为原始音量的 4 倍(自带溢出保护) * @notes 在开启音频采集前后,你都可以使用此接口设定采集音量。 * @return * + 0:成功 * + !0:失败 * @notes + 无论是采集来自麦克风的音频流,还是屏幕音频流,都可以使用此接口进行音量调节。 * + 在开启音频采集前后,你都可以使用此接口设定采集音量。 * @group Audio Management * @order 55 */ setCaptureVolume(index: number, volume: number): number; /** {en} * @brief Adjust the playback volume of the mixed remote audios. You can call this API before or during the playback. * @param volume Ratio(%) of playback volume to original volume, in the range [0, 400], with overflow protection. * This changes the volume property of the audio data other than the hardware volume. * To ensure the audio quality, we recommend setting the volume within `100`. * + 0: mute * + 100: original volume * + 400: Four times the original volume with signal-clipping protection. * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 57 */ /** {zh} * @region 音频管理 * @brief 调节本地播放的所有远端用户音频混音后的音量,混音内容包括远端人声、音乐、音效等。播放音频前或播放音频时,你都可以使用此接口设定播放音量。 * @param volume 音频播放音量,取值范围: [0,400]。 * 只改变音频数据的音量信息,不涉及本端硬件的音量调节。 * 为保证更好的通话质量,建议将 volume 值设为 [0,100]。 * + 0: 静音 * + 100: 原始音量 * + 400: 最大可为原始音量的 4 倍(自带溢出保护) * @returns + 0:成功 * + !0:失败 * @group Audio Management * @order 57 */ setPlaybackVolume(volume: number): number; /** {en} * @brief Adjust the audio playback volume of the remote user * @param room_id ID of the room from which the remote audio source is published * @param user_id Remote user ID of the audio source * @param volume Ratio(%) of playback volume to original volume, in the range [0, 400], with overflow protection. * This changes the volume property of the audio data other than the hardware volume. * To ensure the audio quality, we recommend setting the volume within `100`. * + 0: mute * + 100: original volume. Default value. * + 400: Up to 4 times the original volume (with overflow protection) * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 59 */ /** {zh} * @region 音频管理 * @brief 调节来自远端用户的音频播放音量 * @param room_id 音频来源用户所在的房间 ID * @param user_id 音频来源的远端用户 ID * @param volume 播放音量 * 只改变音频数据的音量信息,不涉及本端硬件的音量调节。 * 取值范围: [0,400]
  • 0: 静音
  • 100: 原始音量,默认值
  • 400: 最大可为原始音量的 4 倍(自带溢出保护) * @returns + 0:成功 * + !0:失败 * @group Audio Management * @order 59 */ setRemoteAudioPlaybackVolume(room_id: string, user_id: string, volume: number): number; /** {en} * @brief Stop the playback test for the local audio device. * @returns + `0`: Success * + `< 0`: Failure. * @notes Call this API to stop the playback test started by calling [startAudioPlaybackDeviceTest](#startaudioplaybackdevicetest) before moving on to the other device tests. * @group Audio Management * @order 47 */ /** {zh} * @region 音频设备管理 * @brief 停止音频播放设备测试。 * @returns 方法调用结果 * + `0`:成功 * + `< 0`:失败 * @notes 调用 [startAudioPlaybackDeviceTest](#startaudioplaybackdevicetest) 后,需调用本方法停止测试。 * @group Audio Management * @order 47 */ stopAudioPlaybackDeviceTest(): number; /** {en} * @brief Set the sound effect type * @param change_type Sound effect type * + `0`: Unchanged * + `1`: Giant * + `2`: Chipmunk * + `3`: Minions * + `4`: Vibrato * + `5`: Robot * @returns + 0: Success * + < 0: Failure. * @notes + You can call it before and after entering the room. * + Effective for both internal and external audio source. * + Only valid for mono-channel audio. * + Only valid in SDKs that include the ability of sound effects. * + Mutually exclusive with setVoiceReverbType, and the effects set later will override the effects set first. * + To use this feature, contact us for technical support. * @group Audio Processing * @order 1 */ /** {zh} * @region 音频管理 * @brief 设置变声特效类型 * @param change_type 变声特效类型。 * + `0`: 原声,不含特效 * + `1`: 巨人 * + `2`: 花栗鼠 * + `3`: 小黄人 * + `4`: 颤音 * + `5`: 机器人 * @returns + 0:成功 * + !0:失败 * @notes + 在进房前后都可设置。 * + 对 RTC SDK 内部采集的音频和自定义采集的音频都生效。 * + 只对单声道音频生效。 * + 只在包含美声特效能力的 SDK 中有效。 * + 与 [setVoiceReverbType](#setvoicereverbtype) 互斥,后设置的特效会覆盖先设置的特效。 * @group Audio Processing * @order 1 */ setVoiceChangerType(change_type: number): number; /** {en} * @brief Set the reverb effect type * @param voice_reverb_type Reverb effect type * + `0`: Unchanged * + `1`: Echo * + `2`: Music concert * + `3`: Ethereal * + `4`: Karaoke * + `5`: Recording studio * @returns + 0: Success * + < 0: Failure. * @notes + You can call it before and after entering the room. * + Effective for both internal and external audio source. * + Only valid for mono-channel audio. * + Only valid in SDKs that include the ability of sound effects. * + Mutually exclusive with setVoiceChangerType, and the effects set later will override the effects set first. * @group Audio Processing * @order 2 */ /** {zh} * @region 音频管理 * @brief 设置混响特效类型 * @param voice_reverb_type 混响特效类型 * + `0`: 原声,不含特效 * + `1`: 回声 * + `2`: 演唱会 * + `3`: 空灵 * + `4`: KTV * + `5`: 录音棚 * @return * + 0:成功 * + !0:失败 * @notes + 在进房前后都可设置。 * + 只对单声道音频生效。 * + 只在包含美声特效能力的 SDK 中有效。 * + 与 [setVoiceChangerType](#setvoicechangertype) 互斥,后设置的特效会覆盖先设置的特效。 * @group Audio Processing * @order 2 */ setVoiceReverbType(voice_reverb_type: number): number; /** {en} * @brief Sets the sound quality * @param audio_profile Sound quality * + `0`: Default sound quality. The sound quality configuration of RoomProfileType set by the server or client. * + `1`: Fluent. Sample rate: 16 KHz. Mono-channel. Encoding bitrate: 32 Kpbs. Low resource consumption, and small network packets guarantees a smooth call. It is suitable for most game scenarios, such as team-wide voice chat, group-wide voice chat, nation-wide voice chat. * + `2`: Mono-channel standard. Sample rate: 24 KHz. Encoding bitrate: 48 Kpbs. For scenarios requiring distinct voice, you can choose this mode, which achieves balanced latency, consumption, and network packets. It is suitable for educational Apps and the online Mafia Games. * + `3`: Dual-channel music. Sample rate: 48 KHz. Encoding bitrate: 128 Kpbs. This mode provides high-resolution audio at a cost of high latency, consumption, and large network packets. It is suitable for music Apps such as co-hosting and online talent contests. Not recommended for game Apps. * + `4`: Dual-channel standard. Sample rate: 48 KHz. Encoding bitrate: 80 Kpbs * + `5`: Mono-channel music. Sample rate: 48 KHz. Encoding bitrate: 64 Kpbs * @returns + `0`: Success * + `!0`: Failure. * @notes + Call this API to change the sound quality if the audio settings in the current RoomProfileType can not meet your requirements. * + You can call this API before and after entering the room. * + Support dynamic switching of sound quality during a call. * @group Audio Management * @order 77 */ /** {zh} * @brief 设置音质档位。 * @param audio_profile 音质档位 * + `0`: 默认音质,服务器下发或客户端已设置的 RoomProfileType 的音质配置 * + `1`: 流畅音质,单声道,采样率为 16 kHz,编码码率为 32 Kbps。流畅优先、低功耗、低流量消耗,适用于大部分游戏场景,如小队语音、组队语音、国战语音等。 * + `2`: 单声道标准音质。采样率为 24 kHz,编码码率为 48 kbps。适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合教育场景和狼人杀等游戏。 * + `3`: 双声道音乐音质。采样率为 48kHz,编码码率为 128 kbps。超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK 等音乐场景。游戏场景不建议使用。 * + `4`: 双声道标准音质。采样率为 48 KHz,编码码率最大值为 80 Kbps。 * + `5`: 单声道音乐音质。采样率为 48 kHz,编码码率最大值为 64 Kbps * @returns + `0`:成功 * + `!0`:失败 * @notes + 设置音质档位。当所选的 audioProfile 中的音频参数无法满足你的场景需求时,调用本接口切换的音质档位。 * + 该方法在进房前后均可调用; * + 支持通话过程中动态切换音质档位。 * @group Audio Management * @order 77 */ setAudioProfile(audio_profile: number): number; /** {en} * @brief Start the playback test for the local audio device. RTC will start playing the audio file specified. And RTC will notify the audio volume via the `onAudioPlaybackDeviceTestVolume` periodically. * @param test_audio_file_path Specify the path of the audio file for the playback test, including *.mp3, *.aac, *.m4a, *.3gp, and *.wav. * @param indication_interval The time interval between each callback in milliseconds. We recommend setting it to 200 ms. The minimal value is 10 ms. * @returns + 0: Success * + < 0: Failure. * @notes + You can call this API whether the user is in the room. * + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests. * @group Audio Management * @order 45 */ /** {zh} * @brief 启动音频播放设备测试。 该方法测试播放设备是否能正常工作。SDK 播放指定的音频文件,测试者如果能听到声音,说明播放设备能正常工作。 * @param test_audio_file_path 音频文件的绝对路径,路径字符串使用 UTF-8 编码格式,支持以下音频格式: mp3,aac,m4a,3gp,wav。 * @param indication_interval 设置 onAudioPlaybackDeviceTestVolume 音量回调的时间间隔,推荐设置为 200 毫秒或以上。单位为毫秒。最小值为 10 毫秒。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes + 该方法必须在 [joinRoom](#joinroom) 前调用,且不可与其它音频设备测试功能同时应用。 * + 你需调用 [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) 停止测试。 * @group Audio Management * @order 45 */ startAudioPlaybackDeviceTest(test_audio_file_path: string, indication_interval: number): number; /** {en} * @brief Starts a call test. * @param echo_test_config Test configurations * @param play_delay_time Delayed audio/video playback time specifying how long you expect to receive the playback after starting the. The range of the value is [2,10] in seconds and the default value is 2. * @returns + 0: Success * + -1: Failure, testing in progress * + -2: Failure, you are in the room * + -3: Failure, neither video nor audio is captured * + -4: Failure, Parameter exception * + -5: Failure, the roomID is already used * @notes + Before entering the room, you can call this API to test whether your local audio/video equipment as well as the upstream and downstream networks are working correctly. * + Once the test starts, SDK will record your sound or video. If you receive the playback within the delay range you set, the test is considered normal.+ Once you start the test, you can either call [stopEchoTest](#stopechotest) or wait until the test stops automatically after 60s, to start the next test or enter the room. * + All APIs related to device control and stream control called before this API are invalidated during the test and are restored after the test. * + All APIs related to device control, stream control, and room entry called during the test do not take effect, and you will receive [onWarning](85533#onwarning) with the warning code `kWarningCodeInEchoTestMode`. * + You will receive the test result from [onEchoTestResult](85533#onechotestresult). * @group Network Management * @order 21 */ /** {zh} * @region 音频设备管理 * @brief 开始音频设备回路测试。 * @param echo_test_config 回路测试参数设置 * @param play_delay_time 音视频延迟播放的时间间隔,用于指定在开始检测多长时间后期望收到回放。取值范围为 [2,10],单位为秒,默认为 2 秒。 * @returns 方法调用结果: * + 0:成功 * + -1:失败,当前用户已经在检测中 * + -2:失败,用户已进房 * + -3:失败,音视频均未采集 * + -4:失败,参数异常 * + -5:失败,已经存在相同 roomId 的房间 * @notes + 在进房前,用户可调用该接口对音视频通话全链路进行检测,包括对音视频设备以及用户上下行网络的检测,从而帮助用户判断是否可以正常发布和接收音视频流。 * + 开始检测后,SDK 会录制你声音或视频。如果你在设置的延时范围内收到了回放,则视为音视频回路测试正常。 * + 调用该方法开始音视频回路检测后,你可以调用 [stopEchoTest](#stopechotest) 立即结束测试,也可等待测试 60s 后自动结束,以更换设备进行下一次测试,或进房。 * + 在该方法之前调用的所有跟设备控制、流控制相关的方法均在开始检测时失效,在结束检测后恢复生效。 * + 在调用 [startEchoTest](#startechotest) 和 [stopEchoTest](#stopechotest) 之间调用的所有跟设备采集、流控制、进房相关的方法均不生效,并会收到 [onWarning](85533#onwarning) 回调,提示警告码为 `kWarningCodeInEchoTestMode`。 * + 音视频回路检测的结果会通过 [onEchoTestResult](85533#onechotestresult) 回调通知。 * @group Network Management * @order 21 */ startEchoTest(echo_test_config: EchoTestConfig, play_delay_time: number): number; /** {en} * @brief Stop the current call test. * @returns + 0: Success * + < 0: Failure. * @notes + After calling [startEchoTest](#startechotest), you must call this API to stop the test. * + After stopping the test with this API, all the system devices and streams are restored to the state they were in before the test. * @group Network Management * @order 23 */ /** {zh} * @region 音频设备管理 * @brief 停止音频设备回路测试。 * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes + 调用 [startEchoTest](#startechotest) 后,需调用本方法停止测试。 * + 音视频回路检测结束后,所有对系统设备及音视频流的控制均会恢复到开始检测前的状态。 * @group Network Management * @order 23 */ stopEchoTest(): number; /** {en} * @brief Try to initialize the audio playback device for device test. * @param device_id Device ID * @returns + 0: Status normal. * + -1: Test not executed. * + -2: Init failed due to lack of permission. * + -3: The device does not exist. No device or device removed. * + -4: The audio format is not supported. * + -5: Error for other reasons * @notes + Call this API before the user joins the room. * + You may still fail to enable the device even you passed the test. Occupation by other application or shortage of CPU / memory may cause the failure. * @group Audio Management * @order 49 */ /** {zh} * @region 音频设备管理 * @brief 尝试初始化音频播放设备,可检测出设备不存在、权限被拒绝/禁用等异常问题。 * @param device_id 设备索引号 * @returns 设备状态错误码 * + 0: 设备检测结果正常 * + -1: 接口状态不正确,例如在正常启动采集后再调用该接口进行检测 * + -2: 采集设备无麦克风权限,尝试初始化设备失败 * + -3: 设备不存在,当前没有设备或设备被移除时返回 * + -4: 设备音频格式不支持 * + -5: 其它原因错误 * @notes 1. 该接口需在进房前调用; * 2. 检测成功不代表设备一定可以启动成功,还可能因设备被其他应用进程独占,或 CPU/内存不足等原因导致启动失败。 * @group Audio Management * @order 49 */ initAudioPlaybackDeviceForTest(device_id: string): number; /** {en} * @brief Try to initialize the audio capture device for device test. * @param device_id Device ID * @returns + 0: Status normal. * + -1: Test not executed. * + -2: Init failed due to lack of permission. * + -3: The device does not exist. No device or device removed. * + -4: The audio format is not supported. * + -5: Error for other reasons * @notes + Call this API before the user joins the room. * + You may still fail to enable the device even you passed the test. Occupation by other application or shortage of CPU / memory may cause the failure. * @group Audio Management * @order 51 */ /** {zh} * @brief 尝试初始化音频播放设备,可检测出设备不存在、权限被拒绝/禁用等异常问题。 * @param device_id 设备索引号 * @returns 设备状态错误码 * + 0: 设备检测结果正常 * + -1: 接口状态不正确,例如在正常启动采集后再调用该接口进行检测 * + -2: 采集设备无麦克风权限,尝试初始化设备失败 * + -3: 设备不存在,当前没有设备或设备被移除时返回 * + -4: 设备音频格式不支持 * + -5: 其它原因错误 * @notes 1. 该接口需在进房前调用; * 2. 检测成功不代表设备一定可以启动成功,还可能因设备被其他应用进程独占,或 CPU/内存不足等原因导致启动失败。 * @group Audio Management * @order 51 */ initAudioCaptureDeviceForTest(device_id: string): number; /** {en} * @brief Enable audio information prompts. * @param config Configuration for audio property prompt. * @notes After enable the prompt, you can: * + Get the information of the audio stream collected by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](85533#onlocalaudiopropertiesreport). * + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](85533#onremoteaudiopropertiesreport). * + Get the information of the active speaker through [onActiveSpeaker](85533#onactivespeaker). * @group Audio Management * @order 63 */ /** {zh} * @brief 启用音频信息提示。 * @param config 音频属性信息提示的相关配置。 * @notes 开启提示后,你可以: * + 通过 [onLocalAudioPropertiesReport](85533#onlocalaudiopropertiesreport) 回调获取本地麦克风和屏幕音频流采集的音频信息。 * + 通过 [onRemoteAudioPropertiesReport](85533#onremoteaudiopropertiesreport) 回调获取订阅的远端用户的音频信息。 * + 通过 [onActiveSpeaker](85533#onactivespeaker) 回调获取房间内的最活跃用户信息。 * @group Audio Management * @order 63 */ enableAudioPropertiesReport(config: AudioPropertiesConfig): number; /** {en} * @brief Enables/disables the loudness equalization function. * @param enable Whether to enable loudness equalization function: * + true: Yes * + false: No * @returns + 0: Success * + < 0: Failure. * @notes + If you call this API with the parameter set to true, the loudness of user's voice will be adjusted to -16 lufs. If then you also call setAudioMixingLoudness and import the original loudness of the audio data used in audio mixing, the loudness will be adjusted to -20lufs when the audio data starts to play. * + You must call this API before starting to play the audio file with startAudioMixing. * @group Audio Management * @order 50 */ /** {zh} * @region 音频管理 * @brief 开启/关闭音量均衡功能。 * @param enable 是否开启音量均衡功能: * @returns + 0: 调用成功 * + <0: 调用失败 * @notes 开启音量均衡功能后,人声的响度会调整为 -16lufs。如果已调用 setAudioMixingLoudness 传入了混音音乐的原始响度,此音乐播放时,响度会调整为 -20lufs。(Linux 不支持) * @group Audio Management * @order 50 */ enableVocalInstrumentBalance(enable: boolean): number; /** {en} * @brief Set an alternative image when the local internal video capture is not enabled. You can repeatedly call this API to update the image. You can set the path to null or open the camera to stop publishing the image. * @param file_path Set the path of the static image. * You can use the absolute path (file://xxx). The maximum size for the path is 512 bytes. * You can upload a .JPG, .JPEG, .PNG, or .BMP file. * When the aspect ratio of the image is inconsistent with the video encoder configuration, the image will be proportionally resized, with the remaining pixels rendered black. The framerate and the bitrate are consistent with the video encoder configuration. * @returns + 0: Success. * + -1: Failure. * @notes + The API is only effective when publishing an internally captured video. * + You cannot locally preview the image. * + You can call this API before and after joining an RTC room. In the multi-room mode, the image can be only displayed in the room you publish the stream. * + You cannot apply effects like filters and mirroring to the image, while you can watermark the image. * + The image is not effective for a screen-sharing stream. * + When you enable the simulcast mode, the image will be added to all video streams, and it will be proportionally scaled down to smaller encoding configurations. * @group Audio & Video Transport * @order 3 */ /** {zh} * @brief 摄像头处于关闭状态时,使用静态图片填充本地推送的视频流。可重复调用该接口来更新图片。若要停止发送图片,可传入空字符串或启用内部摄像头采集。 * @param file_path 设置静态图片的路径。 * 支持本地文件绝对路径,不支持网络链接,长度限制为 512 字节。 * 静态图片支持类型为 JPEG/JPG、PNG、BMP。 * 若图片宽高比与设置的编码宽高比不一致,图片会被等比缩放,黑边填充空白区域。推流帧率与码率与设置的编码参数一致。 * @returns + 0: 成功。 * + -1: 失败。 * @notes + 该接口只适用于 SDK 内部摄像头采集,不适用于自定义视频采集。 * + 本地预览无法看到静态图片。 * + 进入房间前后均可调用此方法。在多房间场景中,静态图片仅在发布的房间中生效。 * + 针对该静态图片,滤镜和镜像效果不生效,水印效果生效。 * + 只有主流能设置静态图片,屏幕流不支持设置。 * + 开启大小流后,静态图片对大小流均生效,且针对小流进行等比例缩小。 * @group Audio & Video Transport * @order 3 */ setDummyCaptureImagePath(file_path: string): number; /** {en} * @brief Enable internal video capture immediately. The default is off. * @returns + `0`: Success * + `!0`: Failure. * @notes + Internal video capture refers to: use the RTC SDK built-in video capture module to capture. * + The local client will be informed via [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) after starting video capture by calling this API. * + The remote clients in the room will be informed of the state change via [onUserStartVideoCapture](85533#onuserstartvideocapture) after the visible client starts video capture by calling this API. * + Call stopVideoCapture to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance. * + Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts. * + To switch from custom to internal video capture, stop publishing before disabling the custom video capture module and then call this API to enable the internal video capture. * @group Video Management * @order 0 */ /** {zh} * @brief 开启内部视频采集。默认为关闭状态。 * @returns + `0`:成功 * + `!0`:失败 * @notes + 内部视频采集指:使用 RTC SDK 内置视频采集模块,进行采集。 * + 调用该方法后,本地用户会收到 [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) 的回调。 * + 本地用户在不可见状态下调用该方法后,房间中的其他用户会收到 [onUserStartVideoCapture](85533#onuserstartvideocapture) 的回调。 * + 调用 stopVideoCapture 可以停止内部视频采集。否则,只有当销毁引擎实例时,内部视频采集才会停止。 * + 创建引擎后,无论是否发布视频数据,你都可以调用该方法开启内部视频采集。 * @group Video Management * @order 0 */ startVideoCapture(): number; /** {en} * @brief Disable internal video capture immediately. The default is off. * @returns + 0: Success * + < 0: Failure. * @notes + Internal video capture refers to: use the RTC SDK built-in video capture module to capture. * + The local client will be informed via onVideoDeviceStateChanged after stopping video capture by calling this API. * + The remote clients in the room will be informed of the state change via onUserStopVideoCapture after the visible client stops video capture by calling this API. * + Call startVideoCapture to enable the internal video capture. * + Without calling this API the internal video capture will sustain until you destroy the engine instance. * @group Video Management * @order 2 */ /** {zh} * @region 视频管理 * @brief 关闭内部视频采集。默认为关闭状态。 * @returns + 0:成功 * + !0:失败 * @notes + 内部视频采集指:使用 RTC SDK 内置视频采集模块,进行采集。 * + 调用该方法后,本地用户会收到 onVideoDeviceStateChanged 的回调。 * + 可见用户进房后调用该方法,房间中的其他用户会收到 onUserStopVideoCapture 的回调。 * + 调用 startVideoCapture 可以开启内部视频采集。 * + 如果不调用本方法停止内部视频采集,则只有当销毁引擎实例时,内部视频采集才会停止。 * @group Video Management * @order 2 */ stopVideoCapture(): number; /** {en} * @brief Get a list of video capture devices in the current system. * @returns Contains a list of all video capture devices in the system. * @group Video Management * @order 11 */ /** {zh} * @brief 获取当前系统内视频采集设备列表。 * @returns 包含系统中所有视频采集设备的列表和相关信息 * @group Video Management * @order 11 */ enumerateVideoCaptureDevices(): { device_name: string; device_id: string; }[]; /** {en} * @brief Set the audio playback device to follow the OS setting or not. * @param followed * + true: follow the OS setting. You can not call [setAudioPlaybackDevice](#setaudioplaybackdevice) at the same time. The default value. * + false: do not follow the OS setting. You can call [setAudioPlaybackDevice](#setaudioplaybackdevice) to set the audio playback device. * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 15 */ /** {zh} * @region 音频设备管理 * @brief 设置音频播放路由是否跟随系统。 * @param followed 音频播放路由是否跟随系统 * + true: 跟随。默认值。此时,调用 [setAudioPlaybackDevice](#setaudioplaybackdevice) 会失败。 * + false: 不跟随系统。此时,可以调用 [setAudioPlaybackDevice](#setaudioplaybackdevice) 进行设置。 * @returns + 0:成功 * + !0:失败 * @group Audio Management * @order 15 */ followSystemPlaybackDevice(followed: boolean): number; /** {en} * @brief Set the audio capture device to follow the OS setting or not. * @param followed * + true: follow the OS setting. Default value. You can not call [setAudioCaptureDevice](#setaudiocapturedevice) at the same time. * + false: do not follow the OS setting. You can call [setAudioCaptureDevice](#setaudiocapturedevice) to set the audio capture device. * @returns + 0: Success * + < 0: Failure. * @group Audio Management * @order 17 */ /** {zh} * @region 音频设备管理 * @brief 设置音频采集路由是否跟随系统。 * @param followed 音频采集路由是否跟随系统 * + true: 跟随。默认值。此时,调用 [setAudioCaptureDevice](#setaudiocapturedevice) 会失败。 * + false: 不跟随系统。此时,可以调用 [setAudioCaptureDevice](#setaudiocapturedevice) 进行设置。 * @return * + 0:成功 * + !0:失败 * @group Audio Management * @order 17 */ followSystemCaptureDevice(followed: boolean): number; /** {en} * @brief Set the current video capture device * @param device_id Video device ID, which can be obtained through [EnumerateVideoCaptureDevices](#enumeratevideocapturedevices) * @returns + 0: Success * + < 0: Failure. * @group Video Management * @order 13 */ /** {zh} * @region 视频设备管理 * @brief 设置当前视频采集设备 * @param device_id 视频设备 ID,可以通过 [EnumerateVideoCaptureDevices](#enumeratevideocapturedevices) 获取 * @return * + 0:方法调用成功 * + !0:方法调用失败 * @group Video Management * @order 13 */ setVideoCaptureDevice(device_id: string): number; /** {en} * @brief Get the video capture device information currently used by the SDK * @returns Device ID * @group Video Management * @order 17 */ /** {zh} * @region 视频设备管理 * @brief 获取当前 SDK 正在使用的视频采集设备 ID * @returns 当前 SDK 正在使用的视频采集设备 ID * @group Video Management * @order 17 */ getVideoCaptureDevice(): string; /** {en} * @brief Video publisher call this API to set the configurations of each stream published, including resolution, frame rate, bitrate, scale mode, and fallback strategy in poor network conditions. * @param solutions List of configurations for multiple streams. You can set parameters for up to 3 streams, SDK will always take the value of the first 3 streams when parameters for more streams are set. * The resolution you set is the maximum resolution of each stream, and must be arranged in descending order. The frame rates must be arranged in descending order. * @returns + 0: Success * + < 0: Failure. * @notes + If you call this API after enabling the mode of publishing multiple streams with [enableSimulcastMode](#enablesimulcastmode), SDK will publish streams as you set, otherwise only the stream with the largest resolution you set will be published. * + Without calling this API to set parameters for multiple video streams, the SDK only publishes one video stream with a resolution of 640px × 360px and a frame rate of 15fps. * + After setting parameters for multiple video streams, SDK will automatically match the streams to be published based on the desired subscription parameters set by subscribers, see [Simulcasting](https://docs.byteplus.com/en/byteplus-rtc/docs/70139) for details. * + This API is applicable to the video stream captured by the camera, see [setScreenVideoEncoderConfig](#setscreenvideoencoderconfig) for setting parameters for screen sharing video stream. * @group Video Management * @order 9 */ /** {zh} * @region 视频管理 * @brief 视频发布端设置推送多路流时各路流的参数,包括最大分辨率、帧率、码率、网络不佳时的回退策略等。 * @param solutions 视频参数数组首地址。要推送的多路视频流的参数需注意,所设置的分辨率是各路流的最大分辨率。 最多支持 3 路参数。当设置了多路参数时,分辨率和帧率必须是依次减小,从大到小排列的。 最大分辨率没有限制。但是如果设置的分辨率无法编码,就会导致编码推流失败。 * @return * + 0:成功 * + !0:失败 * @notes + 该方法是否生效取决于是否同时调用了 [enableSimulcastMode](#enablesimulcastmode) 开启发布多路参数不同的视频流模式。若未开启推送多路流模式,但调用本方法设置了多个分辨率,SDK 默认发布分辨率最大的一条流,多个分辨率的设置会在开启推送多路流模式之后生效。 * + 调用该方法设置多路视频流参数前,SDK 默认仅发布一条分辨率为 640px × 360px,帧率为 15fps 的视频流。 * + 调用该方法设置分辨率不同的多条流后,SDK 会根据订阅端设置的期望订阅参数自动匹配发送的流,具体规则参看[推送多路流](https://www.volcengine.com/docs/6348/70139)文档。 * + 该方法适用于摄像头采集的视频流,设置屏幕共享视频流参数参看 [setScreenVideoEncoderConfig](#setscreenvideoencoderconfig) * @group Video Management * @order 9 */ setVideoEncoderConfig(solutions: VideoEncoderConfig[]): number; /** {en} * @brief Video publisher call this API to set the parameters of the maximum resolution video stream that is expected to be published, including resolution, frame rate, bitrate, scale mode, and fallback strategy in poor network conditions. * @param max_solution The maximum video encoding parameter. * @returns + 0: Success * + < 0: Failure. * @notes + If you call this API after enabling the mode of publishing multiple streams with [enableSimulcastMode](#enablesimulcastmode), SDK will automatically adjust the number of streams published and the parameters of each published stream according to the settings of subscribers. Up to 4 streams will be published, and the resolution you set in this API will be considered as the largest resolution among these 4 streams, see [Publish Multiple Streams](https://www.volcengine.com/docs/6348/70139) for details. Until you enable the mode of publishing multiple streams, SDK will only publish the stream you set. * + Without calling this API, SDK will only publish one stream for you with a resolution of 640px × 360px and a frame rate of 15fps. * + This API is applicable to the video stream captured by the camera, see [setScreenVideoEncoderConfig](#setscreenvideoencoderconfig) for setting parameters for screen sharing video stream. * @group Video Management * @order 22 */ /** {zh} * @region 视频管理 * @brief 视频发布端设置期望发布的最大分辨率视频流参数,包括分辨率、帧率、码率、缩放模式、网络不佳时的回退策略等。 * @param max_solution 期望发布的最大分辨率视频流参数。 * @return * + 0:成功 * + !0:失败 * @notes + 若调用该方法设置了期望发布的最大分辨率的流参数之前,已调用 [enableSimulcastMode](#enablesimulcastmode) 开启发布多路视频流的模式,SDK 会根据订阅端的设置自动调整发布的流数以及各路流的参数,其中最大分辨率为设置的分辨率,流数最多 4 条,具体参看[推送多路流](https://www.volcengine.com/docs/6348/70139)文档;否则仅发布该条最大分辨率的视频流。 * + 调用该方法设置多路视频流参数前,SDK 默认仅发布一条分辨率为 640px × 360px,帧率为 15fps 的视频流。 * + 该方法适用于摄像头采集的视频流,设置屏幕共享视频流参数参看 [setScreenVideoEncoderConfig](#setscreenvideoencoderconfig) * @group Video Management * @order 22 */ setMaxVideoEncoderConfig(max_solution: VideoEncoderConfig): any; /** {zh} * @type api * @region 视频管理 * @brief 开启带有Alpha通道的视频帧编码支持。 * @param index 视频流属性,当前仅支持 `0`,代表主流。 * @param layout 设置 Alpha 通道数据的布局位置。当前仅支持 `kAlphaLayoutTop`,即置于 RGB 通道信息上方。 * @return + 0: 调用成功。 * + < 0 : 调用失败。 * @notes + 适用于需要分离推流端视频主体与背景,且在拉流端可自定义渲染背景的场景。 * + 需要在发布视频流之前调用此接口,否则会调用失败。 * + 开启此接口后,需要配合自定义视频采集 [`pushExternalVideoFrame`](85532#rtcvideo-pushexternalvideoframe),选择 `kVideoPixelFormatRGBA`,把 RGBA 格式视频帧推送至 SDK。 * @group Custom Stream Processing * @order 4.1 */ enableAlphaChannelVideoEncode(index: StreamIndex, layout: AlphaLayout): any; /** {zh} * @type api * @region 视频管理 * @brief 关闭带有Alpha通道的视频帧编码支持。 * @param index 视频流属性,当前仅支持 `0`,代表主流。 * @return + 0: 调用成功。 * + < 0 : 调用失败。 * @notes 需要在停止发布视频流之后调用此接口,否则会调用失败。 * @group Custom Stream Processing * @order 4.2 */ disableAlphaChannelVideoEncode(index: StreamIndex): any; /** {en} * @brief Sets the mirror mode for the captured video stream. * @param mirror_type Mirror type * @returns + 0: Success * + < 0: Failure. * @notes + You must call [setupLocalVideo](85532#rtcvideo-setuplocalvideo) before this API. * + Switching video streams does not affect the settings of the mirror type. * + This API is not applicable to screen-sharing streams. * + Before you call this API, the initial states of each video stream are as follows: * * * * *
    Front-facing cameraBack-facing cameraCustom capturingBuilt-in camera
    Mobile deviceThe preview is mirrored. The published video stream is not mirrored.The preview and the published video stream are not mirrored.The preview and the published video stream are not mirrored./
    PC//The preview and the published video stream are not mirrored.The preview is mirrored. The published video stream is not mirrored.
    * @group Video Processing * @order 1 */ /** {zh} * @region 视频管理 * @brief 为采集到的视频流开启镜像 * @param mirror_type 镜像类型 * @return * + 0:成功 * + !0:失败 * @notes + 必须先调用 [setupLocalVideo](85532#rtcvideo-setuplocalvideo) 设置本地视图后再调用本接口。 * + 切换视频源不影响镜像设置。 * + 屏幕视频流始终不受镜像设置影响。 * + 该接口调用前,各视频源的初始状态如下: * * * * *
    前置摄像头后置摄像头自定义采集视频源 桌面端摄像头
    移动端本地预览镜像,编码传输不镜像 本地预览不镜像,编码传输不镜像 本地预览不镜像,编码传输不镜像 /
    桌面端// 本地预览不镜像,编码传输不镜像 本地预览镜像,编码传输不镜像
    * @group Video Processing * @order 1 */ setLocalVideoMirrorType(mirror_type: MirrorType): number; /** {en} * @brief Enables/Disables the mode of publishing multiple video streams with different encoding configuration. * @param enabled Whether to enable the mode of publishing multiple video streams: * + true: Yes * + false: No(Default setting) * @returns + 0: Success * + < 0: Failure. * @notes You can call this API * - Before entering the room, or * - After entering the room but before publishing streams. * + After setting this API to "true", you can call [SetVideoEncoderConfig](#setvideoencoderconfig) to set encoding configuration for each stream. * + If this function is off, or if this function is on but you don't set the configuration of any stream, only one stream will be sent with a resolution of 640px × 360px and a frame rate of 15fps. * @group Network Management * @order 1 */ /** {zh} * @region 视频管理 * @brief 该方法设置视频流发布端是否开启发布多路编码参数不同的视频流的模式。 * @param enabled 是否开启推送多路视频流模式: * + true:开启 * + false:关闭(默认) * @return * + 0: 调用成功 * + <0: 调用失败 * @notes + 你应在进房前或进房后但未发布流时,调用此方法。 * + 开启推送多路视频流模式后,你可以调用 [`setVideoEncoderConfig`](85532#rtcvideo-setvideoencoderconfig) 为多路视频流分别设置编码参数。 * + 该功能关闭时,或该功能开启但未设置多路流参数时,默认只发一路视频流,该流的编码参数为:分辨率 640px × 360px,帧率 15fps。 * @group Network Management * @order 1 */ enableSimulcastMode(enabled: boolean): number; /** {en} * @brief Video effects license check * @param license_path Absolute path of license file from platforms * @param algo_model_dir The absolute path of the Effects SDK's models file. * @returns + `0`: call succeeded * + `1000`: not integrated cv sdk * + `1001`: cv function is not supported in this RTC version * + `< 0`: Failure Please refer to [Error Code Table](https://docs.byteplus.com/en/effects/docs/error-code-table). * @notes Before you start using video effects, you must first call this method for license verification * @group Video Processing * @order 10 */ /** {zh} * @region 视频特效 * @brief 视频特效许可证检查 * @param license_path 许可证文件绝对路径 * @param algo_model_dir 算法模型绝对路径,即存放特效 SDK 所有算法模型的目录。 * @returns + `0`: 调用成功 * + `1000`: 未集成 CV SDK * + `1001`: 本版本不支持 CV 功能 * + `<0`: 调用失败,具体错误码请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes 开始使用视频特效前,你必须先调用这个方法进行许可证验证 * @group Video Processing * @order 10 */ initCVResource(license_path: string, algo_model_dir: string): number; /** {en} * @brief Get authorization messages from the Effect SDK to obtain online licenses. * @returns Authorization message string address * @notes + You must obtain an online license for the Effect SDK before using the CV functions. * + After obtaining authorization messages through this API, you must refer to [Online Authorization Instructions](https://docs.byteplus.com/en/effects/docs/online-license-guide) to implement the business logic of obtaining online licenses by yourself. * + After obtaining the license, you must call [initCVResource](#initcvresource) to confirm that the license is valid. Then you can use the CV function. * @group Video Processing * @order 12 */ /** {zh} * @brief 从 CV SDK 获取授权消息,用于获取在线许可证。 * @returns 授权消息字符串 * @notes + 使用视频特效的功能前,你必须获取特效 SDK 的在线许可证。 * + 使用背景分割或视频特效的功能前,你必须自行实现获取智能美化特效产品在线许可证的业务逻辑,参考 [在线授权说明](https://www.volcengine.com/docs/6705/102012)。 * + 获取许可证后,建议调用 [initCVResource](#initcvresource) 确认许可证有效,再开始使用背景分割或视频特效功能。 * @group Video Processing * @order 12 */ getAuthMessage(): string; /** {en} * @brief Enables video effects including beauty and color filters. * @return * + 0: Success. * + –1000: The Effects SDK is not integrated. * + –1001: This API is unavailable for your Effects SDK. * + –1002: Your Effects SDK's version is incompatible. * + < 0: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @notes * + You must call [initCVResource](#initcvresource) before calling this API. * + This API does not turn on video effects directly, you must call [setEffectNodes](#seteffectnodes) or [setColorFilter](#setcolorfilter) next. * + Call [disableVideoEffect](#disablevideoeffect) to turn off video effects. * @group Video Processing * @order 11 */ /** {zh} * @brief 开启高级美颜、滤镜等视频特效。 * @return * + 0: 调用成功。 * + –1000: 未集成特效 SDK。 * + –1001: 特效 SDK 不支持该功能。 * + –1002: 特效 SDK 版本不兼容。 * + < 0: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes * + 调用本方法前,必须先调用 [initCVResource](#initcvresource) 进行初始化。 * + 调用该方法后,特效不直接生效,你还需调用 [setEffectNodes](#seteffectnodes) 设置视频特效素材包或调用调用 [setColorFilter](#setcolorfilter) 设置滤镜。 * + 调用 [disableVideoEffect](#disablevideoeffect) 关闭视频特效。 * @group Video Processing * @order 11 */ enableVideoEffect(): number; /** {en} * @brief Disables video effects. * @returns + 0: Success. * + –1000: The Effects SDK is not integrated. * + –1001: This API is unavailable for your Effects SDK. * + –1002: Your Effects SDK's version is incompatible. * + < 0: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @notes Call [enableVideoEffect](#enablevideoeffect) to enable video effects. * @group Video Processing * @order 12 */ /** {zh} * @brief 关闭视频特效。 * @returns + 0: 调用成功。 * + –1000: 未集成特效 SDK。 * + –1001: 特效 SDK 不支持该功能。 * + –1002: 特效 SDK 版本不兼容。 * + < 0: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes 调用 [enableVideoEffect](#enablevideoeffect) 开启视频特效。 * @group Video Processing * @order 12 */ disableVideoEffect(): number; /** {en} * @brief Enables/Disables basic beauty effects. * @param enabled Whether to enable basic beauty effects. * + true: Enables basic beauty effects. * + false: (Default) Disables basic beauty effects. * @returns + 0: Success * + 1000: The Effect SDK is not integrated. * + 1001: This API is not available for your current RTC SDK. * + 1002: This API is not available for your current Effect SDK. You can upgrade your Effect SDK to V4.3.1+. * + 1003: Contact our technical support team for further instructions. * + 1004: Downloading related resources. The beauty effects will take effect after downloading. * + <0: Failure. Effect SDK internal error. For specific error code, see [error codes](https://docs.byteplus.com/effects/docs/error-code-table). * @notes + You cannot use the basic beauty effects and the advanced effect features at the same time. Call [enableVideoEffect](#enablevideoeffect) to use advanced effect features. * + You need to integrate Effect SDK before calling this API. Effect SDK V4.3.1+ is recommended. * + Call [setBeautyIntensity](#setbeautyintensity) to set the beauty effect intensity. If you do not set the intensity, the brightness, smoothness, and sharpness intensity will default to 0.5. * + This API is not applicable to screen capturing. * @group Video Processing * @order 5 */ /** {zh} * @region 视频特效 * @brief 开启/关闭基础美颜 * @param enabled 是否开启基础美颜强度,true: 开启,false: 关闭 * @return * + 0: 开启/关闭成功。 * + 1000: 未集成特效 SDK。 * + 1001: RTC SDK 版本不支持此功能。 * + 1002: 特效 SDK 当前版本不支持此功能,建议使用特效 SDK V4.4.2 版本。 * + 1003: 联系技术支持人员。 * + 1004: 正在下载相关资源,下载完成后生效。 * + <0: 调用失败,特效 SDK 内部错误,具体错误码请参考[错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes + 本方法不能与高级视频特效接口共用。如已购买高级视频特效,建议调用 [enableVideoEffect](#enablevideoeffect) 使用高级特效、贴纸功能等。 * + 使用此功能需要集成特效 SDK,建议使用特效 SDK V4.4.2+ 版本。 * + 调用 [setBeautyIntensity](#setbeautyintensity) 设置基础美颜强度。若在调用本方法前没有设置美颜强度,则初始美白、磨皮、锐化强度均为 0.5。 * + 本方法仅适用于视频源,不适用于屏幕源 * @group Video Processing * @order 5 */ enableEffectBeauty(enabled: boolean): number; /** {en} * @brief Sets the beauty effect intensity. * @param beauty_mode Basic beauty effect * @param intensity Beauty effect intensity in range of [0,1], default to 0.5. When you set it to 0, the beauty effect will be turned off. * @returns + `0`: Success * + `-1000`: The Effect SDK is not integrated. * + `-1001`: This API is not available for your current RTC SDK. * + `<0`: Failure. Effect SDK internal error. For specific error code, see [error codes](https://docs.byteplus.com/effects/docs/error-code-table). * @notes + We recommend to call [initCVResource](#initcvresource) to validate the license before using video effect enhancement. * + If you call this API before calling [enableEffectBeauty](#enableeffectbeauty), the default settings of beauty effect intensity will adjust accordingly. * + If you destroy the engine, the beauty effect settings will be invalid. * @group Video Processing * @order 6 */ /** {zh} * @brief 调整基础美颜强度 * @param beauty_mode 基础美颜模式 * @param intensity 美颜强度,取值范围为 [0,1]。强度为 0 表示关闭,默认强度为 0.5。 * @returns + `0`: 调用成功 * + `-1000`: 未集成 CV SDK * + `-1001`: 本版本不支持 CV 功能 * + `<0`: 调用失败,具体错误码请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes + 获取许可证后,建议调用 [initCVResource](#initcvresource) 确认许可证有效,再开始使用背景分割或视频特效功能。 * + 若在调用 [enableEffectBeauty](#enableeffectbeauty) 前设置美颜强度,则对应美颜功能的强度初始值会根据设置更新。 * + 销毁引擎后,美颜功能强度恢复默认值。 * @group Video Processing * @order 6 */ setBeautyIntensity(beauty_mode: EffectBeautyMode, intensity: number): number; /** {en} * @brief Set video effects material package. * @param effect_node_paths Array of effect material package paths. To remove the current video effect, set it to null. * @returns + 0: Success * + 1000: The Effect SDK is not integrated. * + 1001: This API is not available for your Effect SDK. * + < 0: Failure. For specific error codes * @group Video Processing * @order 13 */ /** {zh} * @brief 设置视频特效素材包,支持同时设置多个素材包 * @param effect_node_paths 特效素材包路径数组。取消当前视频特效,将此参数设置为 null。 * @returns + 0: 调用成功 * + 1000: 未集成 CV SDK * + 1001: 本 RTC 版本不支持 CV 功能 * + <0: 调用失败,具体错误码,请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 13 */ setEffectNodes(effect_node_paths: string[] | null): number; /** {en} * @brief Set the effect intensity * @param effect_node_path Special effects material package path * @param node_key The name of the material key to be set. * @param node_value The intensity value that needs to be set, the value range [0,1], and the setting is invalid when it exceeds the range. * @returns + 0: Success. * + –1000: The Effects SDK is not integrated. * + –1001: This API is unavailable for your Effects SDK. * + –1002: Your Effects SDK's version is incompatible. * + < 0: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @group Video Processing * @order 14 */ /** {zh} * @brief 设置特效强度 * @param effect_node_path 特效素材包路径 * @param node_key 需要设置的素材 key 名称,取值请参考 [素材 key 对应说明](https://www.volcengine.com/docs/6705/102040)。 * @param node_value 需要设置的强度值 取值范围 [0,1],超出范围时设置无效。 * @returns + 0: 调用成功。 * + –1000: 未集成特效 SDK。 * + –1001: 特效 SDK 不支持该功能。 * + –1002: 特效 SDK 版本不兼容。 * + < 0: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 14 */ updateEffectNode(effect_node_path: string, node_key: string, node_value: number): number; /** {en} * @brief Set the color filter. * @param res_path Filter effects package absolute path. * @returns + 0: Success * + < 0: Failure. * + 1000: The Effect SDK is not integrated. * + 1001: This API is not available for your Effect SDK. * + <0: Other errors. * @group Video Processing * @order 15 */ /** {zh} * @region 视频特效 * @brief 设置颜色滤镜 * @param res_path 滤镜资源包绝对路径。 * @returns + 0: 调用成功 * + 1000: 未集成 CV SDK * + 1001: 本 RTC 版本不支持 CV 功能 * + <0: 调用失败,具体错误码,请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 15 */ setColorFilter(res_path: string): number; /** {en} * @brief Set the intensity of the color filter enabled * @param intensity Filter intensity. The value range [0,1] is set to be invalid when the range is exceeded. * @returns + 0: Success * + 1000: The Effect SDK is not integrated. * + 1001: This API is not available for your Effect SDK. * + < 0: Failure. * @group Video Processing * @order 16 */ /** {zh} * @region 视频特效 * @brief 设置已启用颜色滤镜的强度 * @param intensity 滤镜强度。取值范围 [0,1],超出范围时设置无效。 * @returns + 0: 调用成功 * + 1000: 未集成 CV SDK * + 1001: 本 RTC 版本不支持 CV 功能 * + <0: 调用失败,具体错误码,请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 16 */ setColorFilterIntensity(intensity: number): number; /** {en} * @deprecated * @hidden * @brief Create a new task of pushing media streams to CDN and sets the relevant configurations. * @param task_id Task ID. You may want to push more than one mixed stream to CDN from the same room. When you do that, use different ID for corresponding tasks; if you will start only one task, use an empty string. * @param param Configurations to be set when pushing streams to CDN. * @returns + 0: Success * + < 0: Failure. * @notes + When pushing more than one live streams in the same task, SDK will first mix those streams into one single stream and then push it to CDN. * + After calling this API, you will be informed of the result and errors during the pushing process via the onStreamMixingEvent(85533#onstreammixingevent) callback. * + Call [stopLiveTranscoding](#stoplivetranscoding) to stop pushing streams to CDN. */ /** {zh} * @deprecated * @hidden * @brief 开启转推直播,并设置合流的视频视图布局和音频属性。 * @param task_id 转推直播任务 ID。你可以在同一房间内发起多个转推直播任务,并用不同的任务 ID 加以区。当你需要发起多个转推直播任务时,应使用多个 ID;当你仅需发起一个转推直播任务时,建议使用空字符串。 * @param param 转推直播配置参数 * @returns + 0:成功 * + !0:失败 * @notes + 同一个任务中转推多路直播流时,SDK 会先将多路流合成一路流,然后再进行转推。 * + 调用该方法后,关于启动结果和推流过程中的错误,会收到 onStreamMixingEvent(85533#onstreammixingevent) 回调。 * + 调用 [stopLiveTranscoding](#stoplivetranscoding) 停止转推直播。 */ startLiveTranscoding(task_id: string, param: ITranscoderParam): number; /** {en} * @deprecated * @hidden * @brief Stops pushing media streams to CDN. * @param task_id Task ID. Specifys which pushing task you want to stop. * @returns + 0: Success * + < 0: Failure. * @notes You will be informed of the change via the [onStreamMixingEvent](85533#onstreammixingevent). */ /** {zh} * @deprecated * @hidden * @brief 停止转推直播。 * @param task_id 转推直播任务 ID。指定想要停止的转推直播任务。 * @return * + 0:成功 * + !0:失败 * @notes + 会收到 [onStreamMixingEvent](85533#onstreammixingevent) 回调。 * + 关于启动转推直播,参看 [startLiveTranscoding](#startlivetranscoding)。 */ stopLiveTranscoding(task_id: string): number; /** {en} * @deprecated * @hidden * @brief Update parameters needed when pushing media streams to CDN. * @param task_id Task ID. Specifys of which pushing task you want to update the parameters. * @param param Configurations that you want to update. You can update any property for the task unless it is specified as unavailable for updates. * If you left some properties blank, you can expect these properties to be set to their default values. * @returns + 0: Success * + < 0: Failure. * @notes + You will be informed of the change via the onStreamMixingEvent(85533#onstreammixingevent). * + After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations. */ /** {zh} * @deprecated * @hidden * @brief 更新转推直播参数。 * @param task_id 转推直播任务 ID。指定想要更新参数设置的转推直播任务。 * @param param 转推直播配置参数。除特殊说明外,均支持过程中更新。 * 调用时,结构体中没有传入值的属性,会被更新为默认值。 * @returns + 0:成功 * + !0:失败 * @notes + 会收到 onStreamMixingEvent(85533#onstreammixingevent) 回调。 * + 使用 [startLiveTranscoding](#startlivetranscoding) 启用转推直播功能后,使用此方法更新功能配置参数。 */ updateLiveTranscoding(task_id: string, param: ITranscoderParam): number; /** {zh} * @brief 获取时间戳, 单位毫秒 * @returns 时间戳, 单位毫秒 * @group Engine Management * @order 9 */ static getTimestampMs(): number; /** {zh} * @brief 获取时间戳, 单位微秒 * @returns 时间戳, 单位微秒 * @group Engine Management * @order 10 */ static getTimestampUs(): number; /** {zh} * @region 视频管理 * @brief 设置向 SDK 输入的视频源,包括屏幕流。默认使用内部采集。内部采集指:使用 RTC SDK 内置的视频采集机制进行视频采集。 * @param stream_index 视频流的属性 * @param type 视频输入源类型 * @return + 0: 调用成功。 * + < 0 : 调用失败。 * @notes + 该方法进房前后均可调用。 * + 当你已调用 [`startVideoCapture`](85532#rtcvideo-startvideocapture) 开启内部采集后,再调用此方法切换至自定义采集时,SDK 会自动关闭内部采集。 * + 当你调用此方法开启自定义采集后,想要切换至内部采集,你必须先调用此方法关闭自定义采集,然后调用 [`startVideoCapture`](85532#rtcvideo-startvideocapture) 手动开启内部采集。 * @group Custom Stream Processing * @order 0 */ setVideoSourceType(stream_index: StreamIndex, type: VideoSourceType): any; /** {zh} * @brief 推送外部视频帧。 * @param frame 设置视频帧 * @return 方法调用结果: * + 0:成功; * + <0:失败。 * @notes + 支持格式:I420, NV12, RGBA, BGRA, ARGB * + 该函数运行在用户调用线程内 * + 推送外部视频帧前,必须调用 [`setVideoSourceType`](85532#rtcvideo-setvideosourcetype) 开启外部视频源采集。 * @group Custom Stream Processing * @order 2 */ pushExternalVideoFrame(frame: ExternalVideoFrame): any; /** {zh} * @brief 切换音频采集方式 * @param type 音频数据源。 * 默认使用内部音频采集。音频采集和渲染方式无需对应。 * @return 方法调用结果: * + >0: 切换成功。 * + -1:切换失败。 * @notes + 进房前后调用此方法均有效。 * + 如果你调用此方法由内部采集切换至自定义采集,SDK 会自动关闭内部采集。然后,调用 [`pushExternalAudioFrame`](85532#rtcvideo-pushexternalaudioframe) 推送自定义采集的音频数据到 RTC SDK 用于传输。 * + 如果你调用此方法由自定义采集切换至内部采集,你必须再调用 [`startAudioCapture`](85532#rtcvideo-startaudiocapture) 手动开启内部采集。 * @group Custom Stream Processing * @order 7 */ setAudioSourceType(type: AudioSourceType): any; /** {zh} * @brief 推送自定义采集的音频数据到 RTC SDK。 * @param audio_frame 10 ms 对应的音频数据。 * @return 方法调用结果 * + 0:方法调用成功 * + < 0:方法调用失败 * @notes + 推送自定义采集的音频数据前,必须先调用 [`startAudioCapture`](85532#rtcvideo-startaudiocapture) 开启自定义采集。 * + 你必须每 10 ms 推送一次数据。 * @group Custom Stream Processing * @order 9 */ pushExternalAudioFrame(frame: ExternalAudioFrame): any; /** {en} * @brief Create a new task of pushing a single media stream to CDN. * @param task_id Task ID. You may want to start more than one task to push streams to CDN. When you do that, use different IDs for corresponding tasks; if you will start only one task, use an empty string. * @param param Configurations for pushing a single stream to CDN. * @returns + 0: Success * + < 0: Failure. * @notes + After calling this API, you will be informed of the result and errors during the pushing process with [`onStreamPushEvent`](85533#onstreampushevent). * + Call [`stopPushStreamToCDN`](85532#stoppushstreamtocdn) to stop the task. * @group Push to CDN * @order 10 */ /** {zh} * @brief 新增单流转推直播任务。 * @param task_id 任务 ID。你可以发起多个转推直播任务,并用不同的任务 ID 加以区分。当你需要发起多个转推直播任务时,应使用多个 ID;当你仅需发起一个转推直播任务时,建议使用空字符串。 * @param param 转推直播配置参数 * @returns + 0:成功 * + !0:失败 * @notes + 调用该方法后,关于启动结果和推流过程中的错误,会收到 [`onStreamPushEvent`](85533#onstreampushevent) 回调。 * + 调用 [`stopPushStreamToCDN`](85532#stoppushstreamtocdn) 停止任务。 * @group Push to CDN * @order 10 */ startPushSingleStreamToCDN(task_id: string, param: PushSingleStreamParam): number; /** {en} * @brief Stops the task to push a single media stream to CDN. * @param task_id Task ID. Specifys the task to stop. * @returns + 0: Success * + < 0: Failure. * @notes To start the task, refer to [`startPushStreamToCDN`](85532#rtcvideo-startpushsinglestreamtocdn) and [`startPushSingleStreamToCDN`](85532#rtcvideo-startpushsinglestreamtocdn). * @group Push to CDN * @order 12 */ /** {zh} * @brief 停止转推直播。 * @param task_id 转推直播任务 ID。指定想要停止的转推直播任务。 * @return * + 0:成功 * + !0:失败 * @notes 关于启动转推直播,参看 [`startPushStreamToCDN`](85532#rtcvideo-startpushsinglestreamtocdn) 和 [`startPushSingleStreamToCDN`](85532#rtcvideo-startpushsinglestreamtocdn)。 * @group Push to CDN * @order 12 */ stopPushStreamToCDN(task_id: string): number; /** {zh} * @brief 支持根据业务场景,设置通话中的音频降噪模式。 * @param ans_Mode 降噪模式。 * @notes + 该接口可重复调用,仅最后一次调用生效。 * + 降噪算法包含传统降噪和 AI 降噪。传统降噪主要是抑制平稳噪声,比如空调声、风扇声等。而 AI 降噪主要是抑制非平稳噪声,比如键盘敲击声、桌椅碰撞声等。 * + 只有在以下 [RoomProfileType](85535#roomprofiletype) 场景下,调用本接口可以开启 AI 降噪。其余场景的 AI 降噪不会生效。 * + 游戏语音模式:kRoomProfileTypeGame * + 高音质游戏模式:kRoomProfileTypeGameHD * + 云游戏模式:kRoomProfileTypeCloudGame * + 1 vs 1 音视频通话:kRoomProfileTypeChat * + 多端同步播放音视频:kRoomProfileTypeLwTogether * + 云端会议中的个人设备:kRoomProfileTypeMeeting * + 课堂互动模式:kRoomProfileTypeClassroom * + 云端会议中的会议室终端:kRoomProfileTypeMeetingRoom * @group Advanced Features * @order 20 */ /** {en} * @brief Set the Active Noise Cancellation(ANC) mode during audio and video communications. * @param ans_mode ANC modes. * @notes When you repeatedly call this API, only the last call takes effect. * @group Advanced Features * @order 20 */ setAnsMode(ans_mode: AnsMode): number; /** {en} * @hidden * @brief Sets the super resolution mode for remote video stream. * @param stream_key Remote stream information that specifies the source and type of the video stream. * @param mode Super resolution mode. * @returns + `0`: RETURN_STATUS_SUCCESS. It does not indicate the actual status of the super resolution mode, you should refer to [onRemoteVideoSuperResolutionModeChanged](85533#onremotevideosuperresolutionmodechanged) callback. * + `-1`: RETURN_STATUS_NATIVE_IN_VALID. Native library is not loaded. * + `-2`: RETURN_STATUS_PARAMETER_ERR. Invalid parameter. * + `-9`: RETURN_STATUS_SCREEN_NOT_SUPPORT. Failure. Screen stream is not supported. * @notes + Call this API after joining room. * + The original resolution of the remote video stream should not exceed 640 × 360 pixels. * + You can only turn on super-resolution mode for one stream. * @group Video Processing * @order 5 */ /** {zh} * @hidden * @brief 设置远端视频超分模式。 * @param stream_key 远端流信息,用于指定需要设置超分的视频流来源及属性。 * @param mode 超分模式。 * @returns + `0`: RETURN_STATUS_SUCCESS,SDK 调用成功,并不代表超分模式实际状态,需要根据回调 [onRemoteVideoSuperResolutionModeChanged](85533#onremotevideosuperresolutionmodechanged) 判断实际状态。 * + `-1`: RETURN_STATUS_NATIVE_IN_VALID,native library 未加载。 * + `-2`: RETURN_STATUS_PARAMETER_ERR,参数非法,指针为空或字符串为空。 * + `-9`: RETURN_STATUS_SCREEN_NOT_SUPPORT,不支持对屏幕流开启超分。 * @notes + 该方法须进房后调用。 * + 远端用户视频流的原始分辨率不能超过 640 × 360 px。 * + 支持对一路远端流开启超分,不支持对多路流开启超分。 * @group Video Processing * @order 5 */ setRemoteVideoSuperResolution(stream_key: RemoteStreamKey, mode: VideoSuperResolutionMode): number; /** {en} * @brief Take a snapshot of the local video. * @param stream_index Mainstream or screen-sharing stream. * @returns The index of the local snapshot task, starting from `1`. You can get the snapshot from [onTakeLocalSnapshotResult](85533#ontakelocalsnapshotresult). * @notes + The snapshot is taken with all video effects on, like rotation, and mirroring. * + You can take the snapshot either using SDK internal video capture or customized capture. * @group Video Snapshot * @order 30 */ /** {zh} * @brief 截取本地视频画面 * @param stream_index 截图的视频流的属性,为主流还是屏幕流。 * @returns 本地截图任务的编号,从 `1` 开始递增。 调用成功后通过 [onTakeLocalSnapshotResult](85533#ontakelocalsnapshotresult) 回调快照文件。 * @notes + 对截取的画面,包含本地视频处理的全部效果,包含旋转,镜像,美颜等。 * + 不管采用 SDK 内部采集,还是自定义采集,都可以进行截图。 * @group Video Snapshot * @order 30 */ takeLocalSnapshot(stream_index: StreamIndex): number; /** {en} * @brief Take a snapshot of the remote video. * @param stream_key The remote stream you want to take a sanpshot from * @returns The index of the local snapshot task, starting from `1`. You can get the snapshot from [onTakeLocalSnapshotResult](85533#ontakelocalsnapshotresult). * @notes + The snapshot is taken with all video effects on, like rotation, and mirroring. * + You can take the snapshot either using SDK internal video capture or customized capture. * @group Video Snapshot * @order 31 */ /** {zh} * @brief 截取远端视频画面 * @param stream_key 截图的视频流 * @returns 本地截图任务的编号,从 `1` 开始递增。 调用成功后通过 [onTakeLocalSnapshotResult](85533#ontakelocalsnapshotresult) 回调快照文件。 * @notes + 对截取的画面,包含本地视频处理的全部效果,包含旋转,镜像,美颜等。 * + 不管采用 SDK 内部采集,还是自定义采集,都可以进行截图。 * @group Video Snapshot * @order 31 */ takeRemoteSnapshot(stream_key: RemoteStreamKey): number; /** {zh} * @brief 通过 NTP 协议,获取网络时间。 * @notes + 第一次调用此接口会启动网络时间同步功能,并返回 `0`。同步完成后,会收到 [onNetworkTimeSynchronized](85533#onnetworktimesynchronized),此后,再次调用此 API,即可获取准确的网络时间。 * + 在合唱场景下,合唱参与者应在相同的网络时间播放背景音乐。 * @group Network Management * @order 25 */ /** {en} * @brief Obtain the synchronization network time information. * @notes + When you call this API for the first time, you starts synchornizing the network time information and receive the return value `0`. After the synchonization finishes, you will receive [onNetworkTimeSynchronized](85533#onnetworktimesynchronized). After that, calling this API will get you the correct network time. * + Under chorus scenario, participants shall start audio mixing at the same network time. * @group Network Management * @order 25 */ getNetworkTimeInfo(): number; /** {en} * @brief Send audio stream synchronization information. The message is sent to the remote end through the audio stream and synchronized with the audio stream. * @param data Message content. * @param config Configuration related to audio stream synchronization information. * @returns + `>= 0`: Message sent successfully. Returns the number of successful sends. * + `-1`: Message sending failed. Message length greater than 16 bytes. * + `-2`: Message sending failed. The content of the incoming message is empty. * + `-3`: Message sending failed. This screen stream was not published when the message was synchronized through the screen stream. * + `-4`: Message sending failed. This audio stream is not yet published when you synchronize messages with an audio stream captured by a microphone or custom device, as described in ErrorCode. * @notes + Regarding the frequency, we recommend no more than 50 calls per second. * + The data may be lost when the local user is muted. * + After the interface is successfully called, the remote user will receive a [onStreamSyncInfoReceived](85533#onstreamsyncinforeceived) callback. * @group Message * @order 35 */ /** {zh} * @brief 发送音频流同步信息。将消息通过音频流发送到远端,并实现与音频流同步。 * @param data 消息内容。 * @param config 音频流同步信息的相关配置。 * @returns + `>= 0`: 消息发送成功。返回成功发送的次数。 * + `-1`: 消息发送失败。消息长度大于 255 字节。 * + `-2`: 消息发送失败。传入的消息内容为空。 * + `-3`: 消息发送失败。通过屏幕流进行消息同步时,此屏幕流还未发布。 * + `-4`: 消息发送失败。通过用麦克风或自定义设备采集到的音频流进行消息同步时,此音频流还未发布,详见错误码 ErrorCode。 * @notes + 调用本接口的频率建议不超过 50 次每秒。 * + 如果本地用户未说话,此消息不一定会送达。 * + 该接口调用成功后,远端用户会收到 [onStreamSyncInfoReceived](85533#onstreamsyncinforeceived) 回调。 * @group Message * @order 35 */ sendStreamSyncInfo(data: Uint8Array, config: StreamSycnInfoConfig): number; /** {en} * @brief Start cloud proxy * @param cloud_proxies cloud proxy informarion list. * @notes + Call this API before joining the room. * + Start pre-call network detection after starting cloud proxy. * + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](85533#oncloudproxyconnected). * + To stop cloud proxy, call [stopCloudProxy](#stopcloudproxy). * @group Security and Encryption * @order 1 */ /** {zh} * @brief 开启云代理 * @param cloud_proxies 云代理服务器信息列表。 * @notes + 在加入房间前调用此接口 * + 在开启云代理后,进行通话前网络探测 * + 开启云代理后,并成功链接云代理服务器后,会收到 [onCloudProxyConnected](85533#oncloudproxyconnected)。 * + 要关闭云代理,调用 [stopCloudProxy](#stopcloudproxy)。 * @group Security and Encryption * @order 1 */ startCloudProxy(cloud_proxies?: CloudProxyInfo[]): number; /** {en} * @brief Stop cloud proxy * @notes To start cloud proxy, call [startCloudProxy](#startcloudproxy). * @group Security and Encryption * @order 2 */ /** {zh} * @brief 关闭云代理 * @notes 要开启云代理,调用 [startCloudProxy](#startcloudproxy)。 * @group Security and Encryption * @order 2 */ stopCloudProxy(): number; /** {en} * @hidden * @brief Start publishing a public media stream. * @param public_stream_id ID of the public stream * @param param Properties of the public stream. * A public stream can include a bundle of media streams and appears as the designated layout. * @returns + 0: Success. And you will be informed by [`onPushPublicStreamResult`](85533#onpushpublicstreamresult). * + !0: Failure because of invalid parameter or empty parameters. * @notes + Users within the same `appID` can call [`startPlayPublicStream`](#startplaypublicstream) to subscribe to the public stream regardless the user has joined which room or has not joined any room. * + Call [`updatePublicStreamParam`](#updatepublicstreamparam) to update the properties of the public stream which is published by the same user. Calling this API with the same stream ID repeatedly by the same user can not update the existing public stream. * + If Users with different userID call this API with the same stream ID, the public stream will be updated with the parameters passed in the latest call. * + To publish multiple public streams, call this API with different stream ID respectively. * + To stop publishing the public stream, call [`stopPushPublicStream`](#stoppushpublicstream). * + Please contact ts to enable this function before using it. * @group Public Stream * @order 1 */ /** {zh} * @brief 发布一路公共流。 * @param public_stream_id 公共流 ID。 * @param param 公共流参数。 * 一路公共流可以包含多路房间内的媒体流,按照指定的布局方式进行聚合。 * 如果指定的媒体流还未发布,则公共流将在指定流开始发布后实时更新。 * @returns + 0: 成功。同时将收到 [`onPushPublicStreamResult`](85533#onpushpublicstreamresult) 回调。 * + !0: 失败。当参数不合法或参数为空,调用失败。 * @notes + 用户可以指定房间内多个用户发布的媒体流合成一路公共流。使用同一 `appID` 的用户,可以调用 [`startPlayPublicStream`](#startplaypublicstream) 获取和播放指定的公共流。 * + 同一用户使用同一公共流 ID 多次调用本接口无效。如果你希望更新公共流参数,调用 [`updatePublicStreamParam`](#updatepublicstreamparam) 接口。 * + 不同用户使用同一公共流 ID 多次调用本接口时,RTC 将使用最后一次调用时传入的参数更新公共流。 * + 使用不同的 ID 多次调用本接口可以发布多路公共流。 * + 调用 [`stopPushPublicStream`](#stoppushpublicstream) 停止发布公共流。 * + 关于公共流功能的介绍,详见[发布和订阅公共流](https://www.volcengine.com/docs/6348/108930) * @group Public Stream * @order 1 */ startPushPublicStream(public_stream_id: string, param: IPublicStreamParam): number; /** {en} * @hidden * @brief Stop the public stream published by the current user. * @param public_stream_id ID of the public stream * The public stream must be published by the current user. * @returns + 0: Success * + !0: Failure * @notes Refer to [`startPushPublicStream`](#startpushpublicstream) for details about starting publishing a public stream. * @group Public Stream * @order 2 */ /** {zh} * @brief 停止发布当前用户发布的公共流 * @param public_stream_id 公共流 ID * 指定的流必须为当前用户所发布。 * @returns + 0: 成功 * + !0: 失败 * @notes 关于发布公共流,查看 [`startPushPublicStream`](#startpushpublicstream)。 * @group Public Stream * @order 2 */ stopPushPublicStream(public_stream_id: string): number; /** {en} * @hidden * @brief Update the properties of the public stream published by the current user. * @param public_stream_id ID of the public stream * The stream to be updated must be published by the current user. * @param param Properties of the public stream. * @returns + 0: Success * + !0: Failure * @notes + Refer to [`startPushPublicStream`](#startpushpublicstream) for details about starting publishing a public stream. * + Make sure the public stream has started successfully via [`onPushPublicStreamResult`](85533#rtcvideocallback-onpushpublicstreamresult) before calling this API. * @group Public Stream * @order 3 */ /** {zh} * @brief 更新公共流参数 * @param public_stream_id 公共流 ID * @param param 公共流参数。 * 指定的流必须为当前用户所发布的。 * @returns + 0: 成功 * + !0: 失败 * @notes + 关于发布公共流,查看 [`startPushPublicStream`](#startpushpublicstream)。 * + 调用本接口前需要通过 [`onPushPublicStreamResult`](85533#rtcvideocallback-onpushpublicstreamresult) 确认公共流是否已经成功启动。 * @group Public Stream * @order 3 */ updatePublicStreamParam(public_stream_id: string, param: IPublicStreamParam): number; /** {en} * @hidden * @brief Subscribe the public stream. A user can call this method to subscribe a public stream whether he/she has joined the room or not. * @param public_stream_id ID of the public stream. If the stream has not been published then, the local client will receive the public stream once it starts publishing. * @return * + 0: Success. You will also be informed by [`onPlayPublicStreamResult`](85533#onplaypublicstreamresult). * + !0: Failure because of invalid parameter or empty parameters. * @notes * + We recommend to bind a view for the public stream before calling this API to subscribe a public stream. * - Internal renderer: By calling [`setupPublicStreamVideo`](#setuppublicstreamvideo) * - Custom renderer: By calling [`setPublicStreamVideoSink`](#setpublicstreamvideosink) * + After calling this API, you will be informed once the first frame has been decoded successfully by [`onFirstPublicStreamVideoFrameDecoded`](85533#onfirstpublicstreamvideoframedecoded) and [`onFirstPublicStreamAudioFrame`](85533#onfirstpublicstreamaudioframe). * + If the public stream contains SEI information, you will be informed by [`onPublicStreamSEIMessageReceived`](85533#onpublicstreamseimessagereceived). * + Call [`stopPlayPublicStream`](#stopplaypublicstream) to cancel subscribing the public stream. * @group Public Stream * @order 4 */ /** {zh} * @brief 订阅指定公共流。无论用户是否在房间内,都可以调用本接口获取和播放指定的公共流。 * @param public_stream_id 公共流 ID,如果指定流暂未发布,则本地客户端将在其开始发布后接收到流数据。 * @returns + 0: 成功。同时将收到 [`onPlayPublicStreamResult`](85533#onplaypublicstreamresult) 回调。 * + !0: 失败。当参数不合法或参数为空,调用失败。 * @notes + 一个客户端最多同时播放 5 路公共流,请及时调用 [`stopPlayPublicStream`](#stopplaypublicstream) 取消订阅公共流,避免订阅的公共流数量超限。 * + 在调用本接口之前,建议先绑定渲染视图。 * - 调用 [`setupPublicStreamVideo`](#setuppublicstreamvideo) 绑定内部渲染视图: * - 调用 [`setPublicStreamVideoSink`](#setpublicstreamvideosink) 绑定自定义渲染视图: * + 调用本接口后,可以通过 [`onFirstPublicStreamVideoFrameDecoded`](85533#onfirstpublicstreamvideoframedecoded) 和 [`onFirstPublicStreamAudioFrame`](85533#onfirstpublicstreamaudioframe) 回调公共流的视频和音频首帧解码情况。 * + 调用本接口后,可以通过 [`onPublicStreamSEIMessageReceived`](85533#onpublicstreamseimessagereceived) 回调公共流中包含的 SEI 信息。 * @group Public Stream * @order 4 */ startPlayPublicStream(public_stream_id: string): number; /** {en} * @hidden * @brief Cancel subscribing the public stream. * @param public_stream_id public_stream_id ID of the public stream * @return * + 0: Success * + !0: Failure * @notes Call this method to cancel subscribing to the public stream by calling [`startPlayPublicStream`](#startplaypublicstream). * @group Public Stream * @order 5 */ /** {zh} * @brief 取消订阅指定公共流 * @param public_stream_id 公共流 ID * @returns + 0:成功 * + !0:失败 * @notes 关于订阅公共流,查看 [`startPlayPublicStream`](#startplaypublicstream)。 * @group Public Stream * @order 5 */ stopPlayPublicStream(public_stream_id: string): number; /** {en} * @hidden * @brief Assign a internal render view to the public stream. * @param public_stream_id ID of the public stream * @param view Internal render view * @param renderOptions Options for rendering * @returns + `0`: Success * + `-1`: Failure. * @notes + To set the view for the public stream, call this API as soon as you receive [onFirstPublicStreamVideoFrameDecoded](85533#onfirstpublicstreamvideoframedecoded). * + If you need to unbind the stream from the current view, call [`removePublicStreamVideo`](#removepublicstreamvideo). * @group Public Stream * @order 6 */ /** {zh} * @brief 为公共流绑定本地视图 * @param public_stream_id 公共流 ID * @param view 视图 * @param renderOptions 渲染选项 * @returns + `0`:成功 * + `-1`: 失败 * @notes + 监听到 [onFirstPublicStreamVideoFrameDecoded](85533#onfirstpublicstreamvideoframedecoded) 后,调用本 API 绑定公共流。 * + 如果需要解除绑定,调用 [`removePublicStreamVideo`](#removepublicstreamvideo)。 * @group Public Stream * @order 6 */ setupPublicStreamVideo(public_stream_id: string, view: HTMLDivElement, renderOptions?: RenderOptions): number; /** {en} * @hidden * @brief Unbind the public stream from the view * @param public_stream_id ID of the public stream * @returns + `0`: Success * + `-1`: Failure. * @notes Call this API after stopping receiving public stream. * @group Public Stream * @order 7 */ /** {zh} * @brief 为公共流解绑本地视图 * @param public_stream_id 公共流 ID * @returns + `0`:成功 * + `-1`: 失败 * @notes 停止接收公共流时解绑视图。 * @group Public Stream * @order 7 */ removePublicStreamVideo(public_stream_id: string): number; /** {en} * @hidden * @brief Assign a custom renderer to the public stream * @param public_stream_id ID of the public stream * @param required_format Video frame encoding format that applys to custom rendering. * @returns + 0: Success * + !0: Failure * @group Public Stream * @order 8 */ /** {zh} * @brief 为指定公共流绑定自定义渲染器。 * @param public_stream_id 公共流 ID * @param required_format 适用的视频帧编码格式 * @returns + 0:成功 * + !0:失败 * @notes 详见[自定义视频渲染](https://www.volcengine.com/docs/6348/81201)。 * @group Public Stream * @order 8 */ setPublicStreamVideoSink(public_stream_id: string, required_format: PixelFormat): number; /** {en} * @hidden * @brief Assign a custom renderer to the public stream * @param public_stream_id ID of the public stream * @returns + 0: Success * + !0: Failure * @group Public Stream * @order 9 */ /** {zh} * @brief 为指定公共解绑自定义渲染器。 * @param public_stream_id 公共流 ID * @returns + 0:成功 * + !0:失败 * @notes 详见[自定义视频渲染](https://www.volcengine.com/docs/6348/81201)。 * @group Public Stream * @order 9 */ unsetPublicStreamVideoSink(public_stream_id: string): number; /** {en} * @brief When sharing the screen, start using RTC SDK internal collection method to collect screen audio * @param device_id ID of the virtual device. You need to pass the ID to the API only for Mac. * @returns + `0`: Success * + `!0`: Failure. * @notes + After collection, you also need to call [publishScreen](#publishscreen) to collect the screen audio Push to the far end. * + To turn off screen audio internal capture, call [stopScreenAudioCapture](#stopscreenaudiocapture). * @group Screen Sharing * @order 30 */ /** {zh} * @region 屏幕共享 * @brief 在屏幕共享时,开始使用 RTC SDK 内部采集方式,采集屏幕音频 * @param device_id 设备 ID。Mac下需要传入虚拟的声卡id,windows 下不用传入 * @returns + `0`:成功 * + `!0`:失败 * @notes + 采集后,你还需要调用 [publishScreen](#publishscreen) 将采集到的屏幕音频推送到远端。 * + 要关闭屏幕音频内部采集,调用 [stopScreenAudioCapture](#stopscreenaudiocapture)。 * @group Screen Sharing * @order 30 */ startScreenAudioCapture(device_id?: string): number; /** {en} * @brief When sharing the screen, start using RTC SDK internal collection method to collect screen audio on Mac. * @param device_id ID of the virtual device. You need to pass the ID to the API only for Mac. * @returns + 0: Success * + < 0: Failure. * @notes + After collection, you also need to call [publishScreen](#publishscreen) to collect the screen audio Push to the far end. * + To turn off screen audio internal capture, call [stopScreenVideoCapture](#stopscreenvideocapture). * @group Screen Sharing * @order 35 */ /** {zh} * @brief 在屏幕共享时,开始使用 RTC SDK 内部采集方式,采集 Mac 屏幕音频 * @param device_id 虚拟设备 ID * @return * + 0:成功 * + !0:失败 * @notes + 采集后,你还需要调用 [publishScreen](#publishscreen) 将采集到的屏幕音频推送到远端。 * + 要关闭屏幕音频内部采集,调用 [stopScreenAudioCapture](#stopscreenaudiocapture)。 * + mac下需要传入虚拟的声卡id,windows下不用传入 * @group Screen Sharing * @order 35 */ private startMacScreenAudioCapture; /** {en} * @brief Capture screen video stream for sharing. Screen video stream includes: content displayed on the screen, in the application window, or in the virtual screen. * @param source_info Screen capture source information. Call [getScreenCaptureSourceList](#getscreencapturesourcelist) to get all the screen sources that can be shared. * @param capture_params Screen capture parameters * @returns + 0: Success * + < 0: Failure. * @notes + Displaying contents in virtual screens is only available on Windows. * + This API only starts screen capturing but does not publish the captured video. Call [publishScreen](#publishscreen) to publish the captured video. * + To turn off screen video capture, call stopScreenVideoCapture. * + Local users will receive [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) on the state of screen capturing such as start, pause, resume, and error. * + After successfully calling this API, local users will receive [onFirstLocalVideoFrameCaptured](85533#onfirstlocalvideoframecaptured). * + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the frame rate and encoding resolution of the screen video stream. * + After receiving [onFirstLocalVideoFrameCaptured](85533#onfirstlocalvideoframecaptured), you can set the local screen sharing view by calling [setupLocalScreen](#setuplocalscreen). * + Get local screen video frames from [`onLocalScreenFrame`](85533#onlocalscreenframe). * @group Screen Sharing * @order 0 */ /** {zh} * @region 屏幕共享 * @brief 采集屏幕视频流,用于共享。屏幕视频流包括:屏幕上显示的内容,应用窗口中显示的内容,或虚拟屏幕中显示的内容。其中,虚拟屏幕中显示的内容仅在 Windows 平台上支持。 * @param source_info 待共享的屏幕源,你可以调用 [getScreenCaptureSourceList](#getscreencapturesourcelist) 获得所有可以共享的屏幕源。 * @param capture_params 共享参数 * @return * + 0:成功 * + !0:失败 * @notes + 调用此方法仅开启屏幕流视频采集,不会发布采集到的视频。发布屏幕流视频需要调用 [publishScreen](#publishscreen) 。 * + 要关闭屏幕视频源采集,调用 [stopScreenVideoCapture](#stopscreenvideocapture)。 * + 本地用户通过 [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) 的回调获取屏幕采集状态,包括开始、暂停、恢复、错误等。 * + 调用成功后,本端会收到 [onFirstLocalVideoFrameCaptured](85533#onfirstlocalvideoframecaptured) 回调。然后通过调用 [setupLocalScreen](#setuplocalscreen) 设置本地屏幕共享视图。 * + 调用此接口前,你可以调用 [setVideoEncoderConfig](#setvideoencoderconfig) 设置屏幕视频流的采集帧率和编码分辨率。 * + 监听 [`onLocalScreenFrame`](85533#onlocalscreenframe) 本地屏幕视频回调事件。 * @group Screen Sharing * @order 0 */ startScreenVideoCapture(source_info: ScreenCaptureSourceInfo, capture_params: ScreenCaptureParameters): number; /** {en} * @brief Stop recording device audio. * @returns + 0: Success * + < 0: Failure. * @notes To start the device audio recording, call [startScreenAudioCapture](#startscreenaudiocapture). * @group Screen Sharing * @order 31 */ /** {zh} * @region 屏幕共享 * @brief 在屏幕共享时,停止使用 RTC SDK 内部采集方式,采集屏幕音频。 * @return * + 0:成功 * + !0:失败 * @notes 要开始屏幕音频内部采集,调用 [startScreenAudioCapture](#startscreenaudiocapture)。 * @group Screen Sharing * @order 31 */ stopScreenAudioCapture(): number; /** {en} * @brief Stop screen video streaming. * @returns + 0: Success * + < 0: Failure. * @notes + To turn on screen video stream capture, calling [startScreenVideoCapture](#startscreenvideocapture) * + Local users will receive the [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) callback. * + Calling this interface does not affect screen video stream publishing. * @group Screen Sharing * @order 1 */ /** {zh} * @region 屏幕共享 * @brief 停止屏幕视频流采集。 * @return * + 0:成功 * + !0:失败 * @notes + 要开始屏幕音频内部采集,调用 [startScreenAudioCapture](#startscreenaudiocapture)。 * + 调用后,本地用户会收到 [onVideoDeviceStateChanged](85533#onvideodevicestatechanged) 的回调。 * + 调用此接口不影响屏幕视频流发布。 * @group Screen Sharing * @order 1 */ stopScreenVideoCapture(): number; /** {en} * @brief Update the capture area when capturing screen video streams through the capture module provided by the RTC SDK. * @param region_rect Region to be shared. This parameter describes the acquisition area after calling this interface, and the relative relationship between the 'source_info' setting area in [startScreenVideoCapture](#startscreenvideocapture). * @returns + 0: Success * + < 0: Failure. * @notes Before calling this interface, internal screen stream capture must have been turned on by calling [startScreenVideoCapture](#startscreenvideocapture). * @group Screen Sharing * @order 5 */ /** {zh} * @region 屏幕共享 * @brief 更新屏幕共享区域。 * @param region_rect
  • 当共享屏幕时,指定待共享区域相对于虚拟屏幕的位置
  • 当共享窗口时,指定待共享区域相对于整个窗口的位置
  • * 此参数描述了调用此接口后的采集区域,和 [startScreenVideoCapture](#startscreenvideocapture) 中 `source_info` 设定区域的相对关系。 * @return * + 0:成功 * + !0:失败 * @notes 调用此接口前,必须已通过调用 [startScreenVideoCapture](#startscreenvideocapture) 开启了内部屏幕流采集。 * @group Screen Sharing * @order 5 */ updateScreenCaptureRegion(region_rect?: Rectangle): number; /** {en} * @brief Update border highlighting settings when capturing screen video streams through the capture module provided by the RTC SDK. The default display table box. * @param highlight_config Border highlighting settings. * @returns + 0: Success * + < 0: Failure. * @notes Before calling this interface, you must have turned on internal screen flow collection by calling [startScreenVideoCapture](#startscreenvideocapture). * @group Screen Sharing * @order 6 */ /** {zh} * @region 屏幕共享 * @brief 通过 RTC SDK 提供的采集模块采集屏幕视频流时,更新边框高亮设置。默认展示表框。 * @param highlight_config 边框高亮设置 * @return * + 0:成功 * + !0:失败 * @notes 调用此接口前,必须已通过调用 [startScreenVideoCapture](#startscreenvideocapture) 开启了内部屏幕流采集。 * @group Screen Sharing * @order 6 */ updateScreenCaptureHighlightConfig(highlight_config?: HighlightConfig): number; /** {en} * @brief Update the processing settings for the mouse when capturing screen video streams through the capture module provided by the RTC SDK. Default acquisition mouse. * @param state * @returns + 0: Success * + < 0: Failure. * @notes Before calling this interface, internal screen stream capture must have been turned on by calling [startScreenVideoCapture](#startscreenvideocapture). * @group Screen Sharing * @order 3 */ /** {zh} * @region 屏幕共享 * @brief 通过 RTC SDK 提供的采集模块采集屏幕视频流时,更新对鼠标的处理设置。默认采集鼠标。 * @param capture_mouse_cursor 内部采集屏幕视频流时,是否采集鼠标信息 * @return * + 0:成功 * + !0:失败 * @notes 调用此接口前,必须已通过调用 [startScreenVideoCapture](#startscreenvideocapture) 开启了内部屏幕流采集。 * @group Screen Sharing * @order 3 */ updateScreenCaptureMouseCursor(capture_mouse_cursor?: MouseCursorCaptureState): number; /** {en} * @brief When capturing screen video streams through the capture module provided by the RTC SDK, set the window that needs to be filtered. * @param filter_config Window filtering settings * @returns + 0: Success * + < 0: Failure. * @notes + Before calling this interface, internal screen stream capture must have been turned on by calling [startScreenVideoCapture](#startscreenvideocapture). * + This function only works when the screen source category is a screen rather than an application form. * @group Screen Sharing * @order 7 */ /** {zh} * @region 屏幕共享 * @brief 通过 RTC SDK 提供的采集模块采集屏幕视频流时,设置需要过滤的窗口。 * @param filter_config 窗口过滤设置 * @return * + 0:成功 * + !0:失败 * @notes + 调用此接口前,必须已通过调用 [startScreenVideoCapture](#startscreenvideocapture) 开启了内部屏幕流采集。 * + 本函数在屏幕源类别是屏幕而非应用窗体时才起作用。 * @group Screen Sharing * @order 7 */ updateScreenCaptureFilterConfig(filter_config?: number[]): number; /** {en} * @brief Set the audio channel of the screen-sharing audio stream * @param channel The number of Audio channels. * @notes When you call [setScreenAudioStreamIndex](#setscreenaudiostreamindex) to mix the microphone audio stream and the screen-sharing audio stream, the audio channel is set by [setAudioProfile](#setaudioprofile) rather than this API. * @group Screen Sharing * @order 40 */ /** {zh} * @brief 在屏幕共享时,设置屏幕音频流的声道数 * @param channel 声道数 * @notes 当你调用 [setScreenAudioStreamIndex](#setscreenaudiostreamindex) 并设置屏幕音频流和麦克风音频流混流时,此接口不生效,音频通道数由 [setAudioProfile](#setaudioprofile) 控制。 * @group Screen Sharing * @order 40 */ setScreenAudioChannel(channel: AudioChannel): number; /** {en} * @brief Get the item list for screen sharing. * @returns List of the screen-sharing objects, including application window and screens. After the user has decided which item to be shared, pass the object to RTC as an argument of [startScreenVideoCapture](#startscreenvideocapture). * @notes Whether to include the minimized windows is different based on platforms: * + The minimized windows are included in the return value for Windows; * + The minimized windows are not included in the return value for macOS or Linux. * @group Screen Sharing * @order 8 */ /** {zh} * @brief 获取屏幕采集对象列表。 * @returns 屏幕采集对象列表,包括应用窗口和屏幕。由用户选择其中一个共享对象,并在调用 [startScreenVideoCapture](#startscreenvideocapture) 时作为参数传给 RTC SDK。 * @notes 不同的平台上,对最小化的窗口的处理方式不同:在 Windows 平台上,最小化的窗口也会包含在返回列表中;在 macOS 和 Linux 平台上,最小化的窗口不会包含在返回列表中。 * @group Screen Sharing * @order 8 */ getScreenCaptureSourceList(): ScreenCaptureSourceInfo[]; /** {en} * @brief Get the preview thumbnail of the screen-sharing object * @param type Type of the screen capture object * @param source_id ID of the screen-shared object * @param max_width Maximum width of the preview thumbnail * @param max_height Maximum height of the preview thumbnail * @returns + 0: Success * + < 0: Failure. * @group Screen Sharing * @order 9 */ /** {zh} * @brief 获取共享对象缩略图 * @region 屏幕共享 * @param type 屏幕采集对象的类型 * @param source_id 屏幕共享对象的 ID,可通过 [getScreenCaptureSourceList](#getscreencapturesourcelist) 枚举共享对象列表中获取。 * @param max_width 最大宽度。保持采集对象本身的宽高比不变,将缩略图缩放到指定范围内的最大宽高。如果给出的尺寸与共享对象比例不同,得到的缩略图会有黑边。 * @param max_height 最大高度。参见 `maxWidth` 的说明。 * @returns 共享对象缩略图 * @group Screen Sharing * @order 9 */ getThumbnail(type: ScreenCaptureSourceType, source_id: number, max_width: number, max_height: number): ThumbnailInfo; /** {en} * @brief Get application window preview thumbnail for screen sharing. * @param source_id ID of the screen-sharing object. You can get the ID by calling [getScreenCaptureSourceList](#getscreencapturesourcelist). * @param max_width Maximum width of the App icon. The width is always equal to the height. SDK will set the height and width to the smaller value if the given values are unequal. RTC will return nullptr if you set the value with a number out of the valid range, [32, 256]. The default size is 100 x 100. * @param max_height Maximum height of the app icon. Refer to the note for `max_width` * @returns You can get the icon when the item to be shared is an application and the application is assigned with an icon. If not, the return value will be nullptr. * @group Screen Sharing * @order 10 */ /** {zh} * @brief 获取应用窗体所属应用的图标。 * @region 屏幕共享 * @param source_id 屏幕共享对象的 ID,可通过 [getScreenCaptureSourceList](#getscreencapturesourcelist) 枚举共享对象列表中获取。 * @param max_width 最大宽度。返回的图标将是宽高相等的,输入宽高不等时,取二者较小值。宽高范围为 [32,256],超出该范围将返回 nullptr,默认输出 100 x 100 的图像。 * @param max_height 最大高度。参见 `maxWidth` 的说明。 * @returns 应用窗体所属应用的图标。当屏幕共享对象为应用窗体时有效,否则返回 nullptr。 * @group Screen Sharing * @order 10 */ getWindowAppIcon(source_id: number, max_width: number, max_height: number): AppIconInfo; /** {en} * @brief Set the mixing mode of the screen audio stream and the audio stream collected by the microphone when the screen is shared * @param index The mixing mode. * + 'kStreamIndexMain': Mix the audio stream collected by the screen audio stream and the microphone * + 'KStreamIndexScreen ': By default, it divides the screen audio stream and the audio stream collected by the microphone into two audio streams * @returns + 0: Success * + < 0: Failure. * @notes You should call this method before [publishScreen](#publishscreen). Otherwise, you will receive an error from [onWarning](85533#onwarning) : `kWarningCodeSetScreenAudioStreamIndexFailed` * @group Screen Sharing * @order 41 */ /** {zh} * @brief 在屏幕共享时,设置屏幕音频流和麦克风采集到的音频流的混流方式 * @param index 混流方式
  • `0`: 将屏幕音频流和麦克风采集到的音频流混流
  • `1`: 将屏幕音频流和麦克风采集到的音频流分为两路音频流
  • * @returns + 0:成功 * + !0:失败 * @notes 你应该在 [publishScreen](#publishscreen) 之前,调用此方法。否则,你将收到 [onWarning](85533#onwarning) 的报错:kWarningCodeSetScreenAudioStreamIndexFailed` * @group Screen Sharing * @order 41 */ setScreenAudioStreamIndex(index: number): number; /** {en} * @brief Video publisher call this API to set the expected configurations for the screen sharing video stream, including resolution, frame rate, bitrate, and fallback strategy in poor network conditions. * @param screen_solution You expected configurations for screen sharing video stream. * @returns + 0: Success * + < 0: Failure. * @notes Without calling this API, the default encoding parameters for screen sharing video streams are: resolution 1920px × 1080px, frame rate 15fps. * @group Screen Sharing * @order 4 */ /** {zh} * @brief 为发布的屏幕共享视频流设置期望的编码参数,包括分辨率、帧率、码率、网络不佳时的回退策略等。 * @param screen_solution 屏幕共享视频流参数。 * @return * + 0:成功 * + !0:失败 * @notes 调用该方法之前,屏幕共享视频流默认的编码参数为:分辨率 1920px × 1080px,帧率 15fps。 * @group Screen Sharing * @order 4 */ setScreenVideoEncoderConfig(screen_solution: ScreenVideoEncoderConfig): number; /** {en} * @brief Log in to send P2P messages or send messages to a server without joining the RTC room. * @param token Token is required during login for authentication. * This Token is different from that required by calling joinRoom. You can assign any value even null to `roomId` to generate a login token. During developing and testing, you can use temporary tokens generated on the console. Deploy the token generating application on your server. * @param uid User ID which is unique within one appid. * @returns + `0`: Success * + `-1`: Failure due to invalid parameter * + `-2`: Invalid call. RTC will return this value when you call this API after the user has been logged in to the server. * @notes + To log out, call [Logout](#logout). * + You will receive [onLoginResult](85533#onloginresult) after calling this API and log in successfully. But remote users will not receive notification about that. * @group Message * @order 0 */ /** {zh} * @region 实时消息通信 * @brief 登录 RTS 服务器。必须先登录,才能发送房间外点对点消息和向应用服务器发送消息 * @param token 动态密钥。 用户登录必须携带的 Token,用于鉴权验证。 本 Token 与加入房间时必须携带的 Token 不同。测试时可使用控制台生成临时 Token,正式上线需要使用密钥 SDK 在你的服务端生成并下发 Token。 * @param uid 用户 ID 用户 ID 在 appid 的维度下是唯一的。 * @returns + `0`:成功 * + `-1`:失败。无效参数 * + `-2`:无效调用。用户已经登录。成功登录后再次调用本接口将收到此返回值 * @notes + 在调用本接口登录后,如果想要登出,需要调用 [Logout](#logout)。 * + 本地用户调用此方法登录后,会收到 [onLoginResult](85533#onloginresult) 回调通知登录结果,远端用户不会收到通知。 * @group Message * @order 0 */ login(token: string, uid: string): number; /** {en} * @brief Calls this interface to log out, it is impossible to call methods related to out-of-room messages and end-to-server messages or receive related callbacks. * @returns + 0: Success * + < 0: Failure. * @notes + Before calling this interface to log out, you must call [login]({{api}}#login) to log in. * + After local users call this method to log out, they will receive the result of the [onLogout](85533#onlogout) callback notification, and remote users will not receive the notification. * @group Message * @order 1 */ /** {zh} * @region 实时消息通信 * @brief 登出 RTS 服务器。调用本接口登出后,无法调用房间外消息以及端到服务器消息相关的方法或收到相关回调。 * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 调用本接口登出前,必须先调用 [login]({{api}}#login) 登录。 * + 本地用户调用此方法登出后,会收到 [onLogout](85533#onlogout) 回调通知结果,远端用户不会收到通知。 * @group Message * @order 1 */ logout(): number; /** {en} * @brief Update the Token * @param token Token used by the user to log in has a certain valid period. When the Token expires, you need to call this method to update the login Token information. * @returns + 0: Success * + < 0: Failure. * @notes + When calling the [login](#login) method to log in, if an expired token is used, the login will fail and you will receive an [onLoginResult](85533#onloginresult) notification with an error code of kLoginErrorCodeInvalidToken. You need to reacquire the token and call this method to update the token. * + If the token is invalid and the login fails, call this method. After updating the token, the SDK will automatically log back in, and the user does not need to call the [login](#login) method. * + Token expires, if you have successfully logged in, it will not be affected. An expired Token error will be notified to the user the next time you log in with an expired Token, or when you log in again due to a disconnection due to poor local network conditions. * @group Message * @order 5 */ /** {zh} * @region 实时消息通信 * @brief 更新用户用于登录的 Token。 * @param token Token 有一定的有效期,当 Token 过期时,需调用此方法更新登录的 Token 信息。 * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 调用 [login]({{api}}#login) 方法登录时,如果使用了过期的 Token 将导致登录失败,并会收到 [onLoginResult](85533#onloginresult) 回调通知,错误码为 kLoginErrorCodeInvalidToken。此时需要重新获取 Token,并调用此方法更新 Token。 * + 如果 Token 无效导致登录失败,则调用此方法更新 Token 后,SDK 会自动重新登录,而用户不需要自己调用 [login]({{api}}#login) 方法。 * + Token 过期时,如果已经成功登录,则不会受到影响。Token 过期的错误会在下一次使用过期 Token 登录时,或因本地网络状况不佳导致断网重新登录时通知给用户。 * @group Message * @order 5 */ updateLoginToken(token: string): number; /** {en} * @brief Set application server parameters * @param signature Dynamic signature. The App server may use the signature to verify the source of messages. * You need to define the signature yourself. It can be any non-empty string. It is recommended to encode information such as UID into the signature. * The signature will be sent to the address set through the "url" parameter in the form of a POST request. * @param url The address of the application server * @returns + 0: Success * + < 0: Failure. * @notes + Client side calls [sendServerMessage](#sendservermessage) or [sendServerBinaryMessage](#sendserverbinarymessage) Before sending a message to the application server, a valid signature and application server address must be set. * + The user must call [login](#login) to log in before calling this interface. * + After calling this interface, the SDK will use [onServerParamsSetResult](85533#onserverparamssetresult) to return the corresponding result. * @group Message * @order 29 */ /** {zh} * @region 实时消息通信 * @brief 设置业务服务器参数。 * @param signature 动态签名,应用服务器可使用该签名验证消息来源。 * 签名需自行定义,可传入任意非空字符串,建议将 uid 等信息编码为签名。 * 设置的签名会以 post 形式发送至通过本方法中 url 参数设置的应用服务器地址。 * @param url 业务服务器的地址 * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 客户端调用 [sendServerMessage](#sendservermessage) 或 [sendServerBinaryMessage](#sendserverbinarymessage) 发送消息给业务服务器之前,必须设置有效签名和业务服务器地址。 * + 用户必须调用 [login]({{api}}#login) 登录后,才能调用本接口。 * + 调用本接口后,SDK 会使用 [onServerParamsSetResult](85533#onserverparamssetresult) 返回相应结果。 * @group Message * @order 29 */ setServerParams(signature: string, url: string): number; /** {en} * @brief Query the login status of the opposite or local user * @param peer_user_id User ID to be queried * @returns + 0: Success * + < 0: Failure. * @notes * + [login](#login) must be called before this interface can be called. * + After calling this interface, the SDK notifies the query result using the [onGetPeerOnlineStatus](85533#ongetpeeronlinestatus) callback. * + Before sending an out-of-room message, the user can know whether the peer user is logged in through this interface to decide whether to send a message. You can also check your login status through this interface. * @group Message * @order 13 */ /** {zh} * @region 实时消息通信 * @brief 查询对端用户或本端用户的登录状态 * @param peer_user_id 需要查询的用户 ID * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 必须调用 [login]({{api}}#login) 登录后,才能调用本接口。 * + 调用本接口后,SDK 会使用 [onGetPeerOnlineStatus](85533#ongetpeeronlinestatus) 回调通知查询结果。 * + 在发送房间外消息之前,用户可以通过本接口了解对端用户是否登录,从而决定是否发送消息。也可以通过本接口查询自己查看自己的登录状态。 * @group Message * @order 13 */ getPeerOnlineStatus(peer_user_id: string): number; /** {en} * @brief Send a text message (P2P) to a specified user outside the room * @param uid Message receiving user's ID * @param message Text message content sent. Message does not exceed 64 KB. * @param config Message type * @returns + > 0: Sent successfully, return the number of the sent message, increment from 1 * + -1: Sent failed, IRTCVideo instance not created * + -2: Sent failed, uid is empty * @notes + You must call [login](#login) to complete the login before you can send a message in a foreign text of the room. * + After the user calls this interface to send a text message, he will receive an [onUserMessageSendResultOutsideRoom](85533#onusermessagesendresultoutsideroom) callback to know whether the message was successfully sent. * + If the text message is sent successfully, the user specified by uid receives the message via the [onUserMessageReceivedOutsideRoom](85533#onusermessagereceivedoutsideroom) callback. * @group Message * @order 23 */ /** {zh} * @region 实时消息通信 * @brief 给房间外指定的用户发送文本消息(P2P) * @param uid 消息接收用户的 ID * @param message 发送的文本消息内容,消息不超过 64 KB。 * @param config 消息类型 * @return * + `>0`:发送成功,返回这次发送消息的编号,从 1 开始递增 * + `-1`:发送失败,RtcEngine 实例未创建 * + `-2`:发送失败,uid 为空 * @notes + 在发送房间外文本消息前,必须先调用 [login]({{api}}#login) 完成登录。 * + 用户调用本接口发送文本信息后,会收到一次 [onUserMessageSendResultOutsideRoom](85533#onusermessagesendresultoutsideroom) 回调,得知消息是否成功发送。 * + 若文本消息发送成功,则 uid 所指定的用户会通过 [onUserMessageReceivedOutsideRoom](85533#onusermessagereceivedoutsideroom) 回调收到该消息。 * @group Message * @order 23 */ sendUserMessageOutsideRoom(uid: string, message: string, config: MessageConfig): number; /** {en} * @brief Send binary messages (P2P) to a specified user outside the room * @param uid ID of the user receiving the message * @param length Length of the binary string * @param message Content of the binary message sent. Message does not exceed 64 KB. * @param config Message type * @returns + > 0: sent successfully, return the number of the sent message, increment from 1 * + -1: Sent failed, IRTCVideo instance not created * + -2: Sent failed, uid is empty * @notes + [login](#login) must be called before sending out-of-room binary messages. * + After the user calls this interface to send a binary message, he will receive an [onUserMessageSendResultOutsideRoom](85533#onusermessagesendresultoutsideroom) callback to notify whether the message was sent successfully. * + If the binary message is sent successfully, the user specified by uid will receive the message through the [onUserMessageReceivedOutsideRoom](85533#onusermessagereceivedoutsideroom) callback. * @group Message * @order 25 */ /** {zh} * @brief 给房间外指定的用户发送二进制消息(P2P) * @param uid 消息接收用户的 ID * @param length 二进制字符串的长度 * @param message 发送的二进制消息内容,每条消息不超过 64 KB。 * @param config 消息类型 * @return * + `>0`:发送成功,返回这次发送消息的编号,从 1 开始递增 * + `-1`:发送失败,RtcEngine 实例未创建 * + `-2`:发送失败,uid 为空 * @notes + 在发送房间外二进制消息前,必须先调用 [login]({{api}}#login) 完成登录。 * + 用户调用本接口发送二进制消息后,会收到一次 [onUserMessageSendResultOutsideRoom](85533#onusermessagesendresultoutsideroom) 回调,通知消息是否发送成功。 * + 若二进制消息发送成功,则 uid 所指定的用户会通过 [onUserMessageReceivedOutsideRoom](85533#onusermessagereceivedoutsideroom) 回调收到该条消息。 * @group Message * @order 25 */ sendUserBinaryMessageOutsideRoom(uid: string, length: number, message: Uint8Array, config: MessageConfig): number; /** {en} * @brief The client side sends a text message to the application server (P2Server) * @param message The content of the text message sent. The message does not exceed 64 KB. * @returns + > 0: Sent successfully, return the number of the sent message, increment from 1 * + -1: Sent failed, IRTCVideo instance not created * @notes * + Before sending a text message to the application server, you must first call [login](#login) to complete the login, and then call [setServerParams](85532#setserverparams)) Set up the application server. * + After calling this interface, you will receive an [onServerMessageSendResult](85533#onservermessagesendresult) callback to inform the message sender whether the message was sent successfully. * + If the text message is sent successfully, the application server that previously called [setServerParams](85532#setserverparams) will receive the message. * @group Message * @order 31 */ /** {zh} * @region 实时消息通信 * @brief 客户端给业务服务器发送文本消息(P2Server) * @param message 发送的文本消息内容,消息不超过 64 KB。 * @return * + `>0`:发送成功,返回这次发送消息的编号,从 1 开始递增 * + `-1`:发送失败,Video 实例未创建 * @notes + 在向业务服务器发送文本消息前,必须先调用 [login]({{api}}#login) 完成登录,随后调用 [setServerParams](85532#setserverparams) 设置业务服务器。 * + 调用本接口后,会收到一次 [onServerMessageSendResult](85533#onservermessagesendresult) 回调,通知消息发送方是否发送成功。 * + 若文本消息发送成功,则之前调用 [setServerParams](85532#setserverparams) 设置的业务服务器会收到该条消息。 * @group Message * @order 31 */ sendServerMessage(message: string): number; /** {en} * @brief Client side sends binary messages to the application server (P2Server) * @param length Length of binary string * @param message Binary message content sent * Message does not exceed 46KB. * @returns + > 0: Sent successfully, return the number of the sent message, increment from 1 * + -1: Sent failed, IRTCVideo instance not created * @notes * + Before sending a binary message to the application server, you must first call [login](#login) to complete the login, and then call [setServerParams](85532#setserverparams) Set up the application server. * + After calling this interface, you will receive an [onServerMessageSendResult](85533#onservermessagesendresult) callback to inform the message sender that the sending succeeded or failed. * + If the binary message is sent successfully, the application server that previously called [setServerParams](85532#setserverparams) will receive the message. * @group Message * @order 33 */ /** {zh} * @region 实时消息通信 * @brief 客户端给业务服务器发送二进制消息(P2Server) * @param length 二进制字符串的长度 * @param message 发送的二进制消息内容,消息不超过 46KB。 * @return * + `>0`:发送成功,返回这次发送消息的编号,从 1 开始递增 * + `-1`:发送失败,RtcEngine 实例未创建 * @notes + 在向业务服务器发送二进制消息前,必须先调用 [login]({{api}}#login) 完成登录,随后调用 [setServerParams](85532#setserverparams) 设置业务服务器。 * + 调用本接口后,会收到一次 [onServerMessageSendResult](85533#onservermessagesendresult) 回调,通知消息发送方发送成功或失败。 * + 若二进制消息发送成功,则之前调用 [setServerParams](85532#setserverparams) 设置的业务服务器会收到该条消息。 * @group Message * @order 33 */ sendServerBinaryMessage(length: number, message: Uint8Array): number; /** {en} * @brief Sends SEI data. * @param stream_index Specifys the type of media stream that carries SEI data. * In a voice call, you should set this parameter to `kStreamIndexMain`, otherwise the SEI data is discarded and cannot be sent to the remote user. * @param message SEI data. The message would be discarded if it exceeds 4 KB. * @param repeat_count Number of times a message is sent repeatedly. The value range is [0, max{29, %{video frame rate}-1}]. Recommended range: [2,4]. * This value specifies how many consecutive video frames, starting with the current video frame, the SEI data will be added to after calling this API. * @returns + 0: Success * + < 0: Failure. * @notes + We recommend the number of SEI messages per second should not exceed the current video frame rate. Because each SEI is sent with a video frame. While in a voice call, SDK will automatically publish a blank video stream with a resolution of 16px × 16px at a frame rate of 15 fps to carry SEI data. * + In a voice call scenario, this API can be called to send SEI data only in internal capture mode and with a frequency of 15/repeat_count FPS. * + Each video frame carrys only the SEI data received within 2s before and after. In a voice call scenario, if no SEI data is sent within 1min after calling this API, SDK will automatically cancel publishing black frames. * + After the message is sent successfully, the remote user who subscribed your video stream will receive [onSEIMessageReceived](85533#onseimessagereceived). * + When you switch from a voice call to a video call, SEI data transmission will stop and you will need to call this API again to resume the transmission. * @group Message * @order 37 */ /** {zh} * @region 视频管理 * @brief 通过视频帧发送 SEI 数据。 * @param stream_index 媒体流类型
  • 主流。包括:由摄像头/麦克风通过内部采集机制,采集到的视频/音频。
  • 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
  • * @param message SEI 消息。超过 4KB 的消息会被丢弃。 * @param repeat_count 消息发送重复次数。取值范围是 [0, max{29, %{视频帧率}-1}]。推荐范围 [2,4]。 * 调用此接口后,这些 SEI 数据会添加到从当前视频帧开始的连续 `%{repeat_count}` 个视频帧中。 * @return * + \>=0: 将被添加到视频帧中的 SEI 的数量 * + < 0: 发送失败 * @notes + SEI 数据会随视频帧发送。每秒发送的 SEI 消息数量建议不超过当前的视频帧率。在语音通话场景下,SDK 会自动生成一路 16px × 16px 的黑帧视频流用来发送 SEI 数据,帧率为 15 fps。 * + 如果调用此接口之后的 2s 内,没有可带 SEI 的视频帧(比如没有开启视频采集和传输),那么,SEI 数据不会被加进视频帧中。 * + 消息发送成功后,远端会收到 [onSEIMessageReceived](85533#onseimessagereceived) 回调。 * + 语音通话切换至视频通话时,会停止 SEI 数据发送,你需再次调用该接口方可恢复发送。 * @group Message * @order 37 */ sendSEIMessage(stream_index: number, message: Uint8Array, repeat_count: number, mode: SEICountPerFrame): number; /** {en} * @brief Set the video capture parameters for internal capture of the RTC SDK. * @param video_capture_config Video capture parameters. * @returns + 0: Success * + < 0: Failure. * @notes * + This interface can be called after the engine is created and takes effect immediately after being called. It is recommended to call this interface before calling [startVideoCapture](85532#startvideocapture). * + It is recommended that different Engines on the same device use the same video capture parameters. * + If you used the internal module to start video capture before calling this interface, the capture parameters default to Auto. * @group Video Management * @order 7 */ /** {zh} * @region 共享屏幕管理 * @brief 设置 RTC SDK 内部采集时的视频采集参数。指定视频采集参数包括模式、分辨率、帧率。 * @param video_capture_config 视频采集参数 * @returns 方法调用结果: * 0:成功 * !0:失败 * @notes + 本接口在引擎创建后即可调用,建议在调用 [startVideoCapture](85532#startvideocapture) 前调用本接口。 * + 建议同一设备上的不同 Engine 使用相同的视频采集参数。 * + 如果调用本接口前使用内部模块开始视频采集,采集参数默认为 Auto 模式。 * @group Video Management * @order 7 */ setVideoCaptureConfig(video_capture_config?: VideoCaptureConfig): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Start mixing audio files. * @param mix_id ID of the mixing task. Used to identify the mixing task. * If this method is repeatedly called with the same ID, the previous mixing task will be stopped and a new task will start. When the previous task is stopped, you will receive `onAudioMixingStateChanged`. * To mixing multiple audio files at the same time, you can call this method with different mixIDs. * @param file_path The path of the mixing audio file. * You can use the URL of the online file, and the absolute path of the local file. For the URL of the online file, only https protocol is supported. * Recommended audio sample rates: 8KHz, 16KHz, 22.05KHz, 44.1KHz, 48KHz. * Local audio file formats supported by different platforms: * * * * * *
    mp3mp4aacm4a3gpwavoggtswma
    macOSYYYYYY
    WindowsYYYYYYYY
    LinuxY
    * Online audio file formats supported by different platforms: * * * * *
    mp3mp4aacm4a3gpwavoggtswma
    macOSYYYY
    WindowsYYYYYYY
    * @param config Mixing configuration * You can set the number of times the file is played, whether the file is played locally or remotely. * @returns + 0: Success * + < 0: Failure. * @notes + If you have already loaded the file in memory with [preloadAudioMixing](#preloadaudiomixing), ensure that the mixID is the same. * + After calling this method, you will receive `onAudioMixingStateChanged` about the current mixing status. * + Call [stopAudioMixing](#stopaudiomixing) to stop the mixing task. * + You can call this API with different conbinations of ID and file_path to mix multiple audio files at the same time. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 开始播放音乐文件及混音 * @param mix_id 混音 ID,用于标识混音,请保证混音 ID 唯一性。 如果已经通过 [preloadAudioMixing](#preloadaudiomixing) 将音效加载至内存,确保此处的 ID 与 [preloadAudioMixing](#preloadaudiomixing) 设置的 ID 相同。 如果使用相同的 ID 重复调用本方法,前一次混音会停止,后一次混音开始,且 SDK 会使用 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged) 回调通知前一次混音已停止。 * @param file_path 用于混音文件路径。 * 支持在线文件的 URL、和本地文件的绝对路径。对于在线文件的 URL,仅支持 https 协议。 * 推荐的音频文件采样率:8KHz、16KHz、22.05KHz、44.1KHz、48KHz。 * 不同平台支持的本地音频文件格式: * * * * * *
    mp3mp4aacm4a3gpwavoggtswma
    macOSYYYYYY
    WindowsYYYYYYYY
    LinuxY
    * 不同平台支持的在线音频文件格式: * * * * *
    mp3mp4aacm4a3gpwavoggtswma
    macOSYYYY
    WindowsYYYYYYY
    * @param config 混音配置,设置混音的播放次数、是否本地播放混音、以及是否将混音发送至远端 * @return * + 0:成功 * + !0:失败 * @notes + 调用本方法成功播放音乐文件后,SDK 会向本地回调当前的混音状态,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 * + 开始播放音乐文件及混音后,可以调用 [stopAudioMixing](#stopaudiomixing) 方法停止播放音乐文件。 * + 可以通过传入不同的 ID 和 file_path 多次调用本方法,以实现同时播放多个音乐文件,实现混音叠加。 */ startAudioMixing(mix_id: number, file_path: string, config: AudioMixingConfig): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Stop playing music files and mixes * @param mix_id ID of the mixing task * @returns + 0: Success * + < 0: Failure. * @notes + After calling the [startAudioMixing](#startaudiomixing) method to start playing music files and mixes, you can call this method to stop playing music files and mixes. * + After calling this method to stop playing the music file, the SDK notifies the local callback that the mixing has been stopped. See `onAudioMixingStateChanged`. * + After calling this method to stop playing the music file, the music file will be automatically uninstalled. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 停止播放音乐文件及混音 * @param mix_id 混音 ID * @return * + 0:成功 * + !0:失败 * @notes + 调用 [startAudioMixing](#startaudiomixing) 方法开始播放音乐文件及混音后,可以调用本方法停止播放音乐文件及混音。 * + 调用本方法停止播放音乐文件后,SDK 会向本地回调通知已停止混音,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 * + 调用本方法停止播放音乐文件后,该音乐文件会被自动卸载。 */ stopAudioMixing(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Pause playing music files and mixes * @param mix_id ID of the mixing task * @returns + 0: Success * + < 0: Failure. * @notes * + After calling the [startAudioMixing](#startaudiomixing) method to start playing music files and mixes, you can call this method to pause playing music files and mixes. * + After calling this method to pause playing music files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing. * + After calling this method to pause playing the music file, the SDK will notify the local callback that the mixing has been suspended. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 暂停播放音乐文件及混音 * @param mix_id 混音 ID * @return * + 0:成功 * + !0:失败 * @notes + 调用 [startAudioMixing](#startaudiomixing) 方法开始播放音乐文件及混音后,可以通过调用本方法暂停播放音乐文件及混音。 * + 调用本方法暂停播放音乐文件及混音后,可调用 [resumeAudioMixing](#resumeaudiomixing) 方法恢复播放及混音。 * + 调用本方法暂停播放音乐文件后,SDK 会向本地回调通知已暂停混音,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 */ pauseAudioMixing(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Resume playing music files and mixing * @param mix_id mix_id * @returns + 0: Success * + < 0: Failure. * @notes + After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing music files and mixing, you can resume playing and mixing by calling this method. * + After calling this method to resume playing the music file and mixing, the SDK will notify the local callback that the music file is playing. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 恢复播放音乐文件及混音 * @param mix_id 混音 ID * @return * + 0:成功 * + !0:失败 * @notes + 调用 [pauseAudioMixing](#pauseaudiomixing) 方法暂停播放音乐文件及混音后,可以通过调用本方法恢复播放及混音。 * + 调用本方法恢复播放音乐文件及混音后,SDK 会向本地回调通知音乐文件正在播放中,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 */ resumeAudioMixing(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Preload the audio file into memory to minimize the loading cost of playing repeatedly. * @param mix_id ID of the mixing task. Used to identify the mixing task. * If this method is repeatedly called with the same ID, the previous file will be unloaded and the new file will be loaded. * If you call [startAudioMixing](#startaudiomixing) and then call this method with the same ID, the previous mixing task will be stopped, and then the next file will be loaded. * After calling this method to preload A.mp3, if you need to call [startAudioMixing](#startaudiomixing) to play B.mp3 with the same ID, call [unloadAudioMixing](#unloadaudiomixing) to unload A.mp3 first. * @param file_path The path of the file to preload. * You can use the URL of the online file, and the absolute path of the local file. For the URL of the online file, only https protocol is supported. You can only perload the audio file of length less than 20s. * @returns + 0: Success * + < 0: Failure. * @notes + After preloaded, call [startAudioMixing](#startaudiomixing) to play the audio file. * + After calling this method, you will receive `onAudioMixingStateChanged` about the current mixing status. * + Unload the preloaded file with [unloadAudioMixing](#unloadaudiomixing). */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 预加载指定音乐文件到内存中,以避免频繁播放同一文件时的重复加载,减少 CPU 占用。 * @param mix_id 混音 ID 应用调用者维护,请保证唯一性。 如果使用相同的 ID 调用本方法,后一次会覆盖前一次。 如果先调用 [startAudioMixing](#startaudiomixing) ,再使用相同的 ID 调用本方法 ,会先回调 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged) 上一个混音停止,然后加载后一个混音。 使用一个 ID 调用本方法预加载 A.mp3 后,如果需要使用相同的 ID 调用 [startAudioMixing](#startaudiomixing) 播放 B.mp3,请先调用 [unloadAudioMixing](#unloadaudiomixing) 卸载 A.mp3 ,否则会报错 kAudioMixingErrorLoadConflict。 * @param file_path 指定需要混音的本地文件的绝对路径,支持音频文件格式有: mp3,aac,m4a,3gp,wav。 预加载的文件长度不得超过 20s。 * @return * + 0:成功 * + !0:失败 * @notes + 需要频繁播放某个音乐文件的时候,调用本方法预加载该文件,在播放的时候可以只加载一次该文件,减少 CPU 占用。 * + 本方法只是预加载指定音乐文件,只有调用 [startAudioMixing](#startaudiomixing) 方法才开始播放指定音乐文件。 * + 调用本方法预加载音乐文件后,SDK 会回调通知音乐文件已加载,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 * + 调用本方法预加载的指定音乐文件可以通过 [unloadAudioMixing](#unloadaudiomixing) 卸载。 */ preloadAudioMixing(mix_id: number, file_path: string): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Uninstall the specified music file * @param mix_id ID of the mixing task * @returns + 0: Success * + < 0: Failure. * @notes Whether the music file is playing or not, after calling this method to uninstall the file, the SDK will call back to notify that the mix has stopped. See `onAudioMixingStateChanged`. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 卸载指定音乐文件 * @param mix_id 混音 ID * @return * + 0:成功 * + !0:失败 * @notes 不论音乐文件是否播放,调用本方法卸载该文件后,SDK 会回调通知混音已停止,见 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)。 */ unloadAudioMixing(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Adjust the volume of audio mixing, including audio files and PCM data. * @param mix_id ID of the mixing task * @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. * + 0: Mute * + [Default] 100: Original volume * + 400: Maximum volume (with overflow protection) * @param type Mixing type * @returns + 0: Success * + < 0: Failure. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 调节音乐文件在本地和远端播放的音量大小 * @param mix_id 混音 ID * @param volume 音乐文件播放音量范围为 0~400。
  • 0:静音
  • (默认值)100:原始音量
  • 400: 最大可调音量 (自带溢出保护)
  • * @param type 混音播放类型 设置音乐文件是否本地播放、以及是否发送到远端,由此控制音乐文件本地或远端播放的音量 * + `0`: 仅本地播放 * + `1`: 仅发送到远端 * + `2`: 在本地播放并发送到远端 * @return * + 0:成功 * + !0:失败 * @notes + 调用本方法设置音量前,请先调用 [preloadAudioMixing](#preloadaudiomixing) 或 [startAudioMixing](#startaudiomixing)。 * + 为保证更好的音质,建议将 volume 值设为 [0,100]。 */ setAudioMixingVolume(mix_id: number, volume: number, type: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Get the duration of the music file * @param mix_id ID of the mixing task * @returns + 0: Success * + < 0: Failure. * @notes Before calling this method to get the length of the music file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing). */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 获取音乐文件时长 * @param mix_id 混音 ID * @return * + `>0`: 成功, 音乐文件时长,单位为毫秒。 * + `<0`: 失败 * @notes 调用本方法获取音乐文件时长前,需要先调用 [preloadAudioMixing](#preloadaudiomixing) 或 [startAudioMixing](#startaudiomixing)。 */ getAudioMixingDuration(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Get the music file playback progress * @param mix_id ID of the mixing task * @returns + 0: Success * + < 0: Failure. * @notes Before calling this method to get the progress of music file playback, you need to call [startAudioMixing](#startaudiomixing) to start playing music files. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 获取音乐文件播放进度 * @param mix_id 混音 ID * @return * + `>0`: 成功, 音乐文件播放进度,单位为毫秒。 * + `<0`: 失败 * @notes 调用本方法获取音乐文件播放进度前,需要先调用 [startAudioMixing](#startaudiomixing) 开始播放音乐文件。 */ getAudioMixingCurrentPosition(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Set the starting position of the audio file for audio mixing * @param mix_id ID of the mixing task * @param position The starting position in ms. * You can get the length of the file with [getAudioMixingDuration](#getaudiomixingduration). The value of the position must be less than the length of the file. * @returns + 0: Success * + < 0: Failure. * @notes When mixing online files, calling this API may cause mixing delay. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 设置音乐文件的播放位置 * @param mix_id 混音 ID * @param position 音频文件起始播放位置,单位为毫秒。 * 你可以通过 [getAudioMixingDuration](#getaudiomixingduration) 获取音频文件总时长,position 的值应小于音频文件总时长。 * @returns + 0:成功 * + !0:失败 * @notes 在播放在线文件时,调用此接口可能造成播放延迟的现象。 */ setAudioMixingPosition(mix_id: number, position: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Get the duration of the music file * @param mix_id Mixing ID * @returns + `> 0`: Success, the duration of the music file, in milliseconds. * + `< 0`: Failed * @notes Before calling this method to get the length of the music file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing). */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 获取混音音频文件的实际播放时长(单位:毫秒)。 * @param mix_id 混音 ID * @returns + `> 0`: 实际播放时长。 * + `< 0`: 失败 * @notes + 实际播放时长指的是歌曲不受停止、跳转、倍速、卡顿影响的播放时长。例如,若歌曲正常播放到 1:30 时停止播放 30s 或跳转进度到 2:00, 随后继续正常播放 2分钟,则实际播放时长为 3分30秒。 * + 调用本接口前,需要先调用 startAudioMixing 开始播放指定音频文件。 */ getAudioMixingPlaybackDuration(mix_id: number): any; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Set the channel mode of the current audio file * @param mix_id ID of the mixing task * @param mode Channel mode. The default channel mode is the same as the source file. * @returns + 0: Success * + < 0: Failure. * @notes Before calling this method to set the channel mode of the audio file, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 设置当前音频文件的声道模式 * @param mix_id 混音 ID * @param mode 声道模式。默认的声道模式和源文件一致,详见 AudioMixingDualMonoMode。 * @return * + 0:成功 * + !0:失败 * @notes 调用本方法设置音频文件的声道模式前,需要先调用 startAudioMixing 开始播放音频文件。 */ setAudioMixingDualMonoMode(mix_id: number, mode: AudioMixingDualMonoMode): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Enables local playback of music files in a different key, mostly used in Karaoke scenarios. You can adjust the pitch of locally played music files such as ascending or descending with this method. * @param mix_id ID of the mixing task * @param pitch The value that is higher or lower than the original pitch of the audio file within a range from -12 to 12. The default value is 0, i.e. No adjustment is made. * The difference in pitch between two adjacent values within the value range is a semitone, with positive values indicating an ascending tone and negative values indicating a descending tone, and the larger the absolute value set, the more the pitch is raised or lowered. * Out of the value range, the setting fails and triggers the `onAudioMixingStateChanged` callback, indicating `AUDIO_MIXING_STATE_FAILED` for playback failure with AudioMixingState, and `AUDIO_MIXING_ERROR_ID_TYPE_ INVALID_PITCH` for invalid value setting with AudioMixingError. * @returns + 0: Success * + < 0: Failure. * @notes This method needs to be used after calling [startAudioMixing](#startaudiomixing) to start playing the audio file and before calling [`stopAudioMixing`](#stopaudiomixing) to stop playing the audio file, otherwise the `onAudioMixingStateChanged` callback will be triggered. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 开启本地播放音乐文件变调功能,多用于 K 歌场景。 * @param mix_id 混音 ID * @param pitch 相对于音乐文件原始音调的升高/降低值,取值范围[-12,12],默认值为 0,即不做调整。 取值范围内每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调,设置的绝对值越大表示音调升高或降低越多。 超出取值范围则设置失败,并且会触发 onAudioMixingStateChanged 回调,提示 AudioMixingState 状态为 AUDIO_MIXING_STATE_FAILED 混音播放失败,AudioMixingError 错误码为 AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH 设置混音文件音调不合法 * @returns + 0:成功 * + !0:失败 * @notes 本方法需要在调用 [`startAudioMixing`](#startaudiomixing) 开始播放音频文件后、调用 [`stopAudioMixing`](#stopaudiomixing) 停止播放音频文件前使用,否则会触发 [`onAudioMixingStateChanged`](85533#onaudiomixingstatechanged) 回调报错 */ setAudioMixingPitch(mix_id: number, pitch: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Sets the playback speed of the current audio file. * @param mix_id Audio mixing task ID * @param speed * @returns + 0: Success * + < 0: Failure.Ratio of playback speed to original speed in percentage. The range is [50,200], the default value is 100. * If the value you set is out of range, the setting fails, and you will receive an `onAudioMixingStateChanged` callback, in which the AudioMixingState is `kAudioMixingStateFailed` and the AudioMixingError is `kAudioMixingErrorInValidPlaybackSpeed`. * @notes + You should call this API after calling [startAudioMixing](#startaudiomixing) and receiving an `onAudioMixingStateChanged` callback indicating that the AudioMixingState is `kAudioMixingStatePlaying` and the AudioMixingError is `kAudioMixingErrorOk`. * + If you call this API after calling [stopAudioMixing](#stopaudiomixing) or [unloadAudioMixing](#unloadaudiomixing), you will receive an `onAudioMixingStateChanged` callback indicating that the AudioMixingState is `kAudioMixingStateFailed` and the AudioMixingError is `kAudioMixingErrorIdNotFound`. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 设置混音时音频文件的播放速度 * @param mix_id 混音 ID * @param speed 播放速度与原始文件速度的比例,单位:%,取值范围为 [50,200],默认值为 100。 超出取值范围则设置失败,你会收到 onAudioMixingStateChanged 回调,提示 AudioMixingState 状态为 kAudioMixingStateFailed 混音播放失败,AudioMixingError 错误码为 kAudioMixingErrorInValidPlaybackSpeed 设置混音文件的播放速度不合法。 * @return * + 0:成功 * + !0:失败 * @notes + 你需要在调用 startAudioMixing 开始混音,并且收到onAudioMixingStateChanged 回调提示 AudioMixingState 状态为 kAudioMixingStatePlaying,AudioMixingError 错误码为 kAudioMixingErrorOk 之后调用该方法。 * + 在 [stopAudioMixing](#stopaudiomixing) 停止混音或 [unloadAudioMixing](#unloadaudiomixing) 卸载音频文件后调用该 API,会收到状态为 kAudioMixingStateFailed 错误码为 kAudioMixingErrorIdNotFound 的 onAudioMixingStateChanged 回调。 */ setAudioMixingPlaybackSpeed(mix_id: number, speed: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief If you need to call `enableVocalInstrumentBalance` to adjust the volume of the audio file or PCM data used for audio mixing, you must import the original loudness value of the audio file or PCM data via this API. * @param mix_id Audio ID of the mixing task * @param loudness Original loudness of the audio file in lufs. The range is [-70.0, 0.0]. * If the value is set to be less than -70.0lufs, it is automatically adjusted to -70.0lufs. If the value is set to be greater than 0.0lufs, SDK will not equalize the loudness. The default value is 1.0lufs, i.e. No loudness equalization effect. * @notes To avoid sudden volume changes during audio file playback, we recommend that you call this API before starting to play the audio file with [startAudioMixing](#startaudiomixing). * @returns + 0: Success * + < 0: Failure. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 如果你需要使用 enableVocalInstrumentBalance 对混音使音频文件/PCM 音频数据进行音量调整,你必须通过此接口传入其原始响度。 * @param mix_id 混音 ID * @param loudness 原始响度,单位:lufs,取值范围为 [-70.0, 0.0]。 当设置的值小于 -70.0lufs 时,则默认调整为 -70.0lufs,大于 0.0lufs 时,则不对该响度做音均衡处理。默认值为 1.0lufs,即不做处理。 * @return * + 0:成功 * + !0:失败 * @notes 建议在 startAudioMixing 开始播放音频文件之前调用该接口,以免播放过程中的音量突变导致听感体验下降。 */ setAudioMixingLoudness(mix_id: number, loudness: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Set the interval of audio file playback progress callbacks during audio mixing * @param mix_id ID of the mixing task * You can set the interval for multiple IDs by calling this method multiple times and passing in different IDs. * @param interval The time interval (ms) of the audio file playback progress callback in milliseconds. * + The value of interval is a multiple of 10 greater than 0. When the value set is not divisible by 10, the default is rounded up by 10. For example, if the value is set to 52ms, it will be automatically adjusted to 60ms, then the SDK will trigger `onAudioMixingPlayingProgress` callback at the set interval. * + If the value is less than or equals to 0, the callback will not be triggered. * @returns + 0: Success * + < 0: Failure. * @notes This method needs to be used after calling [startAudioMixing](#startaudiomixing) to start playing the audio file, and before calling [stopAudioMixing](#stopaudiomixing) to stop playing the audio file, otherwise an error callback `onAudioMixingStateChanged` will be triggered. * If you want to set the interval of playback progress callbacks before the music file starts playing, you need to call [startAudioMixing](#startaudiomixing) to set the interval in AudioMixingConfig, and you can update the callback interval through this method after the audio file starts playing. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 设置混音时音频文件播放进度回调的间隔 * @param mix_id 混音 ID。可以通过多次调用本接口传入不同的 ID 对多个 ID 进行间隔设置。 * @param interval 音频文件播放进度回调的时间间隔,单位毫秒。 • interval 的值为大于 0 的 10 的倍数,当设置的值不能被 10 整除时,则默认向上取整 10,如设为 52ms 时会默认调整为 60ms。设置完成后 SDK 将会按照设置的时间间隔触发 onAudioMixingPlayingProgress 回调。 • interval 的值小于等于 0 时,不会触发进度回调。 * @return * + 0:成功 * + !0:失败 * @notes 本方法需要在调用 [startAudioMixing](#startaudiomixing) 开始播放音频文件后、调用 [stopAudioMixing](#stopaudiomixing) 停止播放音频文件前使用,否则会触发 onAudioMixingStateChanged 回调报错。 若想在音乐文件开始播放前设置播放进度回调间隔,你需调用 startAudioMixing 在 AudioMixingConfig 中设置时间间隔,开始播放后可以通过此接口更新回调间隔。 */ setAudioMixingProgressInterval(mix_id: number, interval: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Get the track index of the current audio file * @param mix_id Mixding ID * @returns + >=0: Succeeded, the SDK will return the track index of the current audio file. * + < 0: Failed * @notes Before using this method, you should call [startAudioMixing](#startaudiomixing) to start playing the audio file. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @region 混音 * @brief 获取当前音频文件的音轨索引 * @param mix_id 混音 ID * @return * + ≥ 0:成功,返回当前音频文件的音轨索引 * + < 0:方法调用失败 * @notes 调用本方法获取音频文件的音轨前,需要先调用 [startAudioMixing](#startaudiomixing) 开始播放音频文件。 */ getAudioTrackCount(mix_id: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Specify the playback track of the current audio file * @param mix_id ID of the mixing task * @param audio_track_index The specified playback track. * The set parameter value needs to be less than or equal to the return value of [getAudioTrackCount](#getaudiotrackcount). * @returns + 0: Success * + < 0: Failure. * @notes Before using this method, you should call [startAudioMixing](#startaudiomixing) to start playing the audio file. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 指定当前音频文件的播放音轨 * @param mix_id 混音 ID * @param audio_track_index 指定的播放音轨 设置的参数值需要小于或等于 [getAudioTrackCount](#getaudiotrackcount) 的返回值 * @returns + 0:成功 * + !0:失败 * @notes 调用本方法设置音频文件的音轨前,需要先调用 [startAudioMixing](#startaudiomixing) 开始播放音频文件。 */ selectAudioTrack(mix_id: number, audio_track_index: number): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Change local voice to a different key, mostly used in Karaoke scenarios. You can adjust the pitch of local voice such as ascending or descending with this method. * @param pitch The value that is higher or lower than the original local voice within a range from -12 to 12. The default value is 0, Unchanged. * The difference in pitch between two adjacent values within the value range is a semitone, with positive values indicating an ascending tone and negative values indicating a descending tone, and the larger the absolute value set, the more the pitch is raised or lowered. * Out of the value range, the setting fails and triggers [onWarning](85533#onwarning) callback, indicating `WARNING_CODE_SET_SCREEN_STREAM_INVALID_VOICE_PITCH` for invalid value setting with WarningCode. * @returns + 0: Success * + < 0: Failure. * @group Audio Processing * @order 3 */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 开启本地语音变调功能,多用于 K 歌场景。使用该方法,你可以对本地语音的音调进行升调或降调等调整。 * @param pitch 相对于语音原始音调的升高/降低值,取值范围[-12,12],默认值为 0,即不做调整。 * 取值范围内每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调,设置的绝对值越大表示音调升高或降低越多。 * 超出取值范围则设置失败,并且会触发 [onWarning](85533#onwarning) 回调,提示码为 `WARNING_CODE_SET_SCREEN_STREAM_INVALID_VOICE_PITCH` 设置语音音调不合法 * @returns + 0:成功 * + !0:失败 * @group Audio Processing * @order 3 */ setLocalVoicePitch(pitch: number): number; /** {en} * @brief This method records the audio & video data during the call to a local file. * @param type Stream attribute, specify whether to record mainstream or screen stream. * @param config Local recording parameter configuration. * @param recording_type Recording stored file format * @returns + 0: normal * + -1: Parameter setting exception * + -2: The current version of the SDK does not support this Feature, please contact technical support staff * @notes + After calling this method, you will receive an [onRecordingStateUpdate](85533#onrecordingstateupdate) callback. * + If the recording is normal, the system will notify the recording progress through [onRecordingProgressUpdate](85533#onrecordingprogressupdate) callback every second. * @group Recording * @order 1 */ /** {zh} * @region 本地录制 * @brief 该方法将通话过程中的音视频数据录制到本地的文件中。 * @param type 流属性,指定录制主流还是屏幕流
  • 主流。包括:由摄像头/麦克风通过内部采集机制,采集到的视频/音频。
  • 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
  • * @param config 本地录制参数配置 * @param recording_type 录制存储文件格式 * @returns * + 0: 正常 * + -1: 参数设置异常 * + -2: 当前版本 SDK 不支持该特性,请联系技术支持人员 * @notes + 调用该方法后,你会收到 [onRecordingStateUpdate](85533#onrecordingstateupdate) 回调。 * + 如果录制正常,系统每秒钟会通过 [onRecordingProgressUpdate](85533#onrecordingprogressupdate) 回调通知录制进度。 * @group Recording * @order 1 */ startFileRecording(type: StreamIndex, config: RecordingConfig, recording_type: RecordingType): number; /** {en} * @brief Stop local recording * @param type Stream attribute, specify to stop mainstream or screen stream recording. * @returns + 0: Success * + < 0: Failure. * @notes + Call [startFileRecording](#startfilerecording) After starting local recording, you must call this method to stop recording. * + After calling this method, you will receive an [onRecordingStateUpdate](85533#onrecordingstateupdate) callback prompting you to record the result. * @group Recording * @order 2 */ /** {zh} * @region 本地录制 * @brief 停止本地录制 * @param type 流属性,指定停止主流或者屏幕流录制
  • 主流。包括:由摄像头/麦克风通过内部采集机制,采集到的视频/音频。
  • 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
  • * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 调用 [startFileRecording](#startfilerecording) 开启本地录制后,你必须调用该方法停止录制。 * + 调用该方法后,你会收到 [onRecordingStateUpdate](85533#onrecordingstateupdate) 回调提示录制结果。 * @group Recording * @order 2 */ stopFileRecording(type: number): number; /** {en} * @brief Sets the fallback option for published audio & video streams. You can call this API to set whether to automatically lower the resolution you set of the published streams under limited network conditions. * @param option Fallback option * @returns + 0: Success * + < 0: Failure. * @notes + This API only works after you call [enableSimulcastMode](#enablesimulcastmode) to enable the mode of publishing multiple streams. * + You must call this API before entering the room. * + After you allow video stream to fallback, your stream subscribers will receive [onSimulcastSubscribeFallback](85533#onsimulcastsubscribefallback) when the resolution of your published stream are lowered or restored. * + You can alternatively set fallback options with distrubutions from server side, which is of higher priority. * @group Network Management * @order 5 */ /** {zh} * @region 音视频回退 * @brief 设置发布的音视频流回退选项 。你可以调用这个接口来设置网络情况不佳或设备性能不足时只发送小流,以保证通话质量。 * @param option 本地发布的音视频流回退选项
  • 0:(默认)上行网络较弱或性能不佳时,不对音视频流作回退处理。
  • >1:上行网络较弱或性能不佳时,只发送视频小流。 * @return * + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 该方法仅在调用 [enableSimulcastMode](#enablesimulcastmode) 开启了发送多路视频流的情况下生效。 * + 你必须在进房前设置,进房后设置或更改设置无效。 * + 调用该方法后,如因性能或网络不佳产生发布性能回退或恢复,本端会提前收到 [onPerformanceAlarms](85533#rtcvideocallback-onperformancealarms) 回调发出的告警,以便采集设备配合调整。 * + 设置回退选项后,本端发布的音视频流发生回退或从回退中恢复时,订阅该音视频流的客户端会收到 [onSimulcastSubscribeFallback](85533#onsimulcastsubscribefallback) 回调,通知该情况。 * + 你可以调用 API 或者在服务端下发策略设置回退。当使用服务端下发配置实现时,下发配置优先级高于在客户端使用 API 设定的配置。 * @group Network Management * @order 5 */ setPublishFallbackOption(option: number): number; /** {en} * @brief Sets the fallback option for subscribed RTC streams. You can call this API to set whether to lower the resolution of currently subscribed stream under limited network conditions. * @param option Fallback option * @returns + 0: Success * + < 0: Failure. * @notes + You must call this API before enterting the room. * + After you enables the fallback, you will receive [onSimulcastSubscribeFallback](85533#onsimulcastsubscribefallback) and [onRemoteVideoSizeChanged](85533#onremotevideosizechanged) when the resolution of your subscribed stream is lowered or restored. * + You can alternatively set fallback options with distrubutions from server side, which is of higher priority. * @group Network Management * @order 7 */ /** {zh} * @region 音视频回退 * @brief 设置订阅的音视频流回退选项。 你可以通过调用该接口来设置网络情况不佳或性能不足时只订阅小流或音频流,以保证通话质量。 * @param option 远端订阅流回退处理选项
  • `0`: 关闭订阅音视频流时的性能回退功能
  • `1`: 只接收视频小流
  • `2`: 先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流
  • * @returns 方法调用结果 * + 0:方法调用成功 * + <0:方法调用失败 * @notes + 你必须在进房前设置,进房后设置或更改设置无效。 * + 设置回退选项后,本端订阅的音视频流发生回退或从回退中恢复时,会收到 [onSimulcastSubscribeFallback](85533#onsimulcastsubscribefallback) 回调通知。 * + 设置回退选项后,本端订阅的视频流因为回退分辨率发生变化时,会收到 [onRemoteVideoSizeChanged](85533#onremotevideosizechanged) 回调通知。 * + 你可以调用 API 或者在服务端下发策略设置回退。当使用服务端下发配置实现时,下发配置优先级高于在客户端使用 API 设定的配置。 * @group Network Management * @order 7 */ setSubscribeFallbackOption(option: number): number; /** {en} * @brief Set user priority * @param room_id Room ID * @param user_id Remote user's ID * @param priority Remote user's requirement priority. * @returns + 0: Success * + < 0: Failure. * @notes + 1. This method is used with [setSubscribeFallbackOption](#setsubscribefallbackoption). * + 2. If the subscription flow fallback option is turned on, weak connections or insufficient performance will give priority to ensuring the quality of the flow received by high-priority users. * + 3. This method can be used before and after entering the room, and the priority of the remote user can be modified. * @group Network Management * @order 9 */ /** {zh} * @region 音视频回退 * @brief 设置用户优先级 * @param room_id 房间 ID * @param user_id 远端用户的 ID * @param priority 远端用户的需求优先级 * @returns + 0: 方法调用成功 * + <0: 方法调用失败 * @notes + 1. 该方法与 [setSubscribeFallbackOption](#setsubscribefallbackoption) 搭配使用。 * + 2. 如果开启了订阅流回退选项,弱网或性能不足时会优先保证收到的高优先级用户的流的质量。 * + 3. 该方法在进房前后都可以使用,可以修改远端用户的优先级。 * @group Network Management * @order 9 */ setRemoteUserPriority(room_id: string, user_id: string, priority: RemoteUserPriority): number; /** {en} * @brief Pre-call network detection * @param is_test_uplink Whether to detect uplink bandwidth * @param expected_uplink_bitrate Expected uplink bandwidth, unit: kbpsRange: {0, [100-10000]}, `0`: Auto, that RTC will set the highest bite rate. * @param is_test_downlink Whether to detect downlink bandwidth * @param expected_downlink_biterate Expected downlink bandwidth, unit: kbpsRange: {0, [100-10000]}, `0`: Auto, that RTC will set the highest bite rate. * @returns + 0: Network probing enabled successfully. * + 1: Failed to start probing. Parameter error, both uplink and downlink probes are 'false ', or the expected bandwidth exceeds the range [100,10000] * + 2: Failed to start probing. The reason for the failure is that the local push-pull flow has started. * + 3: Detection has started, no need to open it again. * + 4: Do not support this feature. * @notes + After calling this interface, you will receive [onNetworkDetectionResult](85533#onnetworkdetectionresult) within 3s and every 2s thereafter notifying the probe result; * + If the probe stops, you will receive [onNetworkDetectionStopped](85533#onnetworkdetectionstopped) notify that probing has stopped. * @group Network Management * @order 11 */ /** {zh} * @region 网络探测 * @brief 开启通话前网络探测 * @param is_test_uplink 是否探测上行带宽 * @param expected_uplink_bitrate 期望上行带宽,单位:kbps范围为 {0, [100-10000]},其中, 0 表示由 SDK 指定最高码率。 * @param is_test_downlink 是否探测下行带宽 * @param expected_downlink_biterate 期望下行带宽,单位:kbps范围为 {0, [100-10000]},其中, 0 表示由 SDK 指定最高码率。 * @returns + 0: 成功开启网络探测。 * + 1: 开始探测失败。参数错误,上下行探测均为 `false`,或期望带宽超过了范围 [100,10000] * + 2: 开始探测失败。失败原因为,本地已经开始推拉流 * + 3: 已经开始探测,无需重复开启 * + 4: 不支持该功能 * @notes + 成功调用本接口后,会在 3s 内收到一次 [onNetworkDetectionResult](85533#onnetworkdetectionresult) 回调,此后每 2s 会收到一次该回调,通知探测结果; * + 若探测停止,则会收到一次 [onNetworkDetectionStopped](85533#onnetworkdetectionstopped) 通知探测停止。 * @group Network Management * @order 11 */ startNetworkDetection(is_test_uplink: boolean, expected_uplink_bitrate: number, is_test_downlink: boolean, expected_downlink_biterate: number): number; /** {en} * @brief Stop pre-call network probe * @returns + 0: Success * + < 0: Failure. * @notes After calling this interface, you will receive [onNetworkDetectionStopped](85533#onnetworkdetectionstopped) notifying that the the probing has stopped. * @group Network Management * @order 13 */ /** {zh} * @brief 停止通话前网络探测 * @return * + 0:成功 * + !0:失败 * @notes 调用本接口后,会收到一次 [onNetworkDetectionStopped](85533#onnetworkdetectionstopped) 回调通知探测停止。 * @group Network Management * @order 13 */ stopNetworkDetection(): number; /** {en} * @brief Set the original background to a specified image or a solid color. To disable this effect, set the modelPath parameter to null. * @param background_sticker_path The absolute path of virtual background effects * @param source Virtual background source * @returns + `0`: Success * + `-1000`:The BytePlus Effects SDK is not integrated. * + `-1001`:This feature is not supported in the BytePlus Effects SDK. * + `–1002`: Your Effects SDK's version is incompatible. * + `<0`:Other errors. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @notes + You must call [initCVResource](#initcvresource) before calling this API. * + Call [disableVirtualBackground](#disablevirtualbackground) to turn off the virtual background. * @group Video Processing * @order 17 */ /** {zh} * @brief 将摄像头采集画面中的人像背景替换为指定图片或纯色背景。 * @param background_sticker_path 背景贴纸特效素材绝对路径。 * @param source 背景贴纸对象。 * @returns + `0`: 调用成功 * + `-1000`: 未集成 CV SDK * + `-1001`: 本版本不支持 CV 功能 * + `–1002`: 特效 SDK 版本不兼容 * + `<0`: 调用失败,具体错误码请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes + 调用本方法前,必须先调用 [initCVResource](#initcvresource)。 * + 调用 [disableVirtualBackground](#disablevirtualbackground) 关闭虚拟背景。 * @group Video Processing * @order 17 */ enableVirtualBackground(background_sticker_path: string, source: VirtualBackgroundSource): number; /** {en} * @brief Turns off the virtual background. * @returns + `0`: Success. * + `–1000`: The Effects SDK is not integrated. * + `–1001`: This API is unavailable for your Effects SDK. * + `–1002`: Your Effects SDK's version is incompatible. * + `< 0`: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @notes After calling [enableVirtualBackground](#enablevirtualbackground) to enable the virtual background function, you can call this API to turn it off. * @group Video Processing * @order 18 */ /** {zh} * @brief 关闭虚拟背景。 * @returns + `0`: 调用成功。 * + `–1000`: 未集成特效 SDK。 * + `–1001`: 特效 SDK 不支持该功能。 * + `–1002`: 特效 SDK 版本不兼容。 * + `< 0`: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes 调用 [enableVirtualBackground](#enablevirtualbackground) 开启虚拟背景后,可以调用此接口关闭虚拟背景。 * @group Video Processing * @order 18 */ disableVirtualBackground(): number; /** {en} * @brief Starts face detection and registers the observer for the result. * @param interval_ms The minimum time interval between two callbacks in milliseconds. The value should be greater than 0. The actual time interval is between `interval_ms` and `interval_ms+the time slot of a captured video frame`. * @param face_model_path The absolute path of the face detection algorithm file. Typically it is the tt_face_vXXX.model file in the ttfacemodel folder. * @returns + `0`: Success. * + `–1000`: The Effects SDK is not integrated. * + `–1001`: This API is unavailable for your Effects SDK. * + `–1002`: Your Effects SDK's version is incompatible. * + `-1004`: Initializing. This function will be available when the initialization is completed. * + `<0`: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @notes With this observer, you will receive [onFaceDetectResult](85533#onfacedetectresult) periodically. * @group Video Processing * @order 64 */ /** {zh} * @brief 开启人脸识别功能,并设置人脸检测结果回调观察者。 * @param interval_ms 两次回调之间的最小时间间隔,必须大于 0,单位为毫秒。实际收到回调的时间间隔大于 `interval_ms`,小于 `interval_ms+视频采集帧间隔`。 * @param face_model_path 人脸检测算法模型文件路径,一般为 ttfacemodel 文件夹中 tt_face_vXXX.model 文件的绝对路径。 * @returns + `0`: 调用成功。 * + `–1000`: 未集成特效 SDK。 * + `–1001`: 特效 SDK 不支持该功能。 * + `–1002`: 特效 SDK 版本不兼容。 * + `-1004`: 初始化中,初始化完成后启动此功能。 * + `<0`: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes 此观察者后,你会周期性收到 [onFaceDetectResult](85533#onfacedetectresult) 回调。 * @group Video Processing * @order 64 */ enableFaceDetection(interval_ms: number, face_model_path: string): number; /** {en} * @brief Stops face detection. * @returns + `0`: Success. * + `–1000`: The Effects SDK is not integrated. * + `–1001`: This API is unavailable for your Effects SDK. * + `–1002`: Your Effects SDK's version is incompatible. * + `<0`: Other error. See [error code table](https://docs.byteplus.com/effects/docs/error-code-table) for specific instructions. * @group Video Processing * @order 65 */ /** {zh} * @brief 关闭人脸识别功能。 * @returns + `0`: 调用成功。 * + `–1000`: 未集成特效 SDK。 * + `–1001`: 特效 SDK 不支持该功能。 * + `–1002`: 特效 SDK 版本不兼容。 * + `<0`: 调用失败,错误码对应具体描述参看 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 65 */ disableFaceDetection(): number; /** {en} * @brief Adds watermark to designated video stream. * @param stream_index The index of the target stream. * @param image_path File path of the watermark image. You can use the absolute path or the asset path(/assets/xx.png). The path should be less than 512 bytes. * The watermark image should be in PNG or JPG format. * @param config Watermark configurations * @returns + 0: Success * + < 0: Failure. * @notes + Call [clearVideoWatermark](#clearvideowatermark) to remove the watermark from the designated video stream. * + You can only add one watermark to one video stream. The newly added watermark replaces the previous one. You can call this API multiple times to add watermarks to different streams. * + If you mirror the preview, or the preview and the published stream, the watermark will also be mirrored locally, but the published watermark will not be mirrored. * + When you enable simulcast mode, the watermark will be added to all video streams, and it will be scaled down to smaller encoding configurations accordingly. * @group Video Processing * @order 3 */ /** {zh} * @brief 在指定视频流上添加水印。 * @param stream_index 需要添加水印的视频流属性。 * @param image_path 水印图片路径,支持本地文件绝对路径和Asset 资源路径(/assets/xx.png),长度限制为 512 字节。 * 水印图片为 PNG 或 JPG 格式。 * @param config 水印参数 * @returns + 0: 调用成功 * + 1000: 未集成 CV SDK * + 1001: 本版本不支持 CV 功能 * + <0: 调用失败,具体错误码请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @notes + 调用 [clearVideoWatermark](#clearvideowatermark) 移除指定视频流的水印。 * + 同一路流只能设置一个水印,新设置的水印会代替上一次的设置。你可以多次调用本方法来设置不同流的水印。 * + 进入房间前后均可调用此方法。 * + 若开启本地预览镜像,或开启本地预览和编码传输镜像,则远端水印均不镜像;在开启本地预览水印时,本端水印会镜像。 * + 开启大小流后,水印对大小流均生效,且针对小流进行等比例缩小。 * @group Video Processing * @order 3 */ setVideoWatermark(stream_index: number, image_path: string, config: RTCWatermarkConfig): number; /** {en} * @brief Removes video watermark from designated video stream. * @param stream_index Targeting stream index of the watermark. * @returns + 0: Succeed. * + 1000: Integrating CV SDK failed. * + 1001: Invalid SDK version * + <0: Failed. * @group Video Processing * @order 4 */ /** {zh} * @brief 移除指定视频流的水印。 * @param stream_index 需要移除水印的视频流属性,参看 StreamIndex。 * @returns + 0: 调用成功 * + 1000: 未集成 CV SDK * + 1001: 本版本不支持 CV 功能 * + <0: 调用失败,具体错误码请参考 [错误码表](https://www.volcengine.com/docs/6705/102042)。 * @group Video Processing * @order 4 */ clearVideoWatermark(stream_index: number): any; /** {en} * @brief Set the view for the local video. * @param view View * @param render_options Render options * @returns + `0`: Success * + `-1`: Failure. * @notes If you need to unbind the video stream from the current view, call [`removeLocalVideo`](#removelocalvideo). * @group Video Management * @order 21 */ /** {zh} * @brief 设置本地视频渲染时使用的视图,并设置渲染模式。 * @param view 视图 * @param render_options 渲染选项 * @returns + `0`:成功 * + `-1`: 失败 * @notes 如果需要解除绑定,调用 [`removeLocalVideo`](#removelocalvideo)。 * @group Video Management * @order 21 */ setupLocalVideo(view: HTMLDivElement, render_options?: RenderOptions): number; /** {en} * @brief Unbind the local video from the view. * @returns + `0`: Success * + `-1`: Failure. * @group Video Management * @order 23 */ /** {zh} * @brief 解绑本地视频流已绑定的渲染视图 * @returns + `0`:成功 * + `-1`: 失败 * @group Video Management * @order 23 */ removeLocalVideo(): number; /** {en} * @brief Set the view for the remote video. * @param user_id User ID * @param room_id Room ID * @param view View * @param render_options Render options * @returns + `0`: Success * + `-1`: Failure. * @notes + To set the view for the remote video stream, call this API as soon as you receive [onUserPublishStream](85533#onuserpublishstream). * + If you need to unbind the remote video stream from the current view, call [`removeRemoteVideo`](#removeremotevideo) or [`removeAllRemoteVideo`](#removeallremotevideo). * + The setting expires as the local user leaves the room. The remote user leaving the room does not affect the setting. * @group Video Management * @order 25 */ /** {zh} * @brief 为远端视频流绑定本地渲染视图,并设置渲染模式。 * @param user_id 远端用户 ID * @param room_id 房间 ID * @param view 视图 * @param render_options 渲染选项 * @returns + `0`:成功 * + `-1`: 失败 * @notes + 监听到 [onUserPublishStream](85533#onuserpublishstream) 后,调用本 API 绑定远端流。 * + 如果需要解除绑定,调用 [`removeRemoteVideo`](#removeremotevideo) 或 [`removeAllRemoteVideo`](#removeallremotevideo)。 * + 本地用户离开房间时,会解除调用此 API 建立的绑定关系;远端用户离开房间则不会影响。 * @group Video Management * @order 25 */ setupRemoteVideo(user_id: string, room_id: string, view: HTMLDivElement, render_options?: RenderOptions): number; /** {en} * @brief Unbind the remote video from the view * @param user_id User ID * @param room_id Room ID * @returns + `0`: Success * + `-1`: Failure. * @notes Call this API after stopping receiving the remote video. * @group Video Management * @order 26 */ /** {zh} * @brief 解绑指定远端视频流已绑定的本地视图 * @param user_id 远端用户 ID * @param room_id 房间 ID * @returns + `0`:成功 * + `-1`: 失败 * @notes 停止接收远端视频流时应解绑视图 * @group Video Management * @order 26 */ removeRemoteVideo(user_id: string, room_id: string): number; /** {en} * @brief Unbind all remote videos from the views * @param room_id Room ID * @returns + `0`: Success * + `-1`: Failure. * @notes Call this API after stopping receiving the remote video. * @group Video Management * @order 27 */ /** {zh} * @brief 解绑所有已绑定本地视图的指定远端视频流 * @param room_id 房间 ID * @returns + `0`:成功 * + `-1`: 失败 * @notes 停止接收远端视频流时应解绑视图 * @group Video Management * @order 27 */ removeAllRemoteVideo(room_id: string): number; /** {en} * @brief Set the view for the local screen-sharing stream to preview the sharings. * @param view View * @param render_options * @returns + `0`: Success * + `-1`: Failure. * @notes + Call this API before starting screen sharing. * + If you need to unbind the stream from the current view, call [`removelocalScreen`](#removeremotescreen). * @group Video Management * @order 8 */ /** {zh} * @brief 为本地屏幕共享流绑定视图,实现预览 * @param view 视图 * @param render_options 渲染选项 * @returns + `0`:成功 * + `-1`: 失败 * @notes + 本地发起屏幕共享需要先绑定视图 * + 如果需要解除绑定,调用 [`removeLocalScreen`](#removelocalscreen)。 * @group Video Management * @order 8 */ setupLocalScreen(view: HTMLDivElement, render_options?: RenderOptions): number; /** {en} * @brief Unbind the screen-sharing stream from the view * @returns + 0: Success * + < 0: Failure. * @notes Call this API after stopping screen sharing. * @group Video Management * @order 9 */ /** {zh} * @brief 解绑屏幕共享流已绑定的视图 * @returns 0:成功 * !0: 失败 * @notes 本地停止屏幕共享时解绑视图 * @group Video Management * @order 9 */ removeLocalScreen(): number; /** {en} * @brief Set the view for the remote screen-sharing stream * @param user_id User ID * @param room_id Room ID * @param view View * @param render_options Render options * @returns + `0`: Success * + `-1`: Failure. * @notes + To set the view for the remote screen-sharing stream, call this API as soon as you receive [onUserPublishScreen](85533#onuserpublishscreen). * + If you need to unbind the local video stream from the current view, call [`removeRemoteScreen`](#removeremotescreen). * @group Video Management * @order 10 */ /** {zh} * @brief 为远端屏幕共享流绑定本地视图 * @param user_id 远端用户 ID * @param room_id 房间 ID * @param view 视图 * @param render_options 渲染选项 * @returns 0:成功 * -1: 失败 * @notes + 监听到 [onUserPublishScreen](85533#onuserpublishscreen) 后,调用本 API 绑定远端屏幕共享流。 * + 如果需要解除绑定,调用 [`removeRemoteScreen`](#removeremotescreen)。 * @group Video Management * @order 10 */ setupRemoteScreen(user_id: string, room_id: string, view: HTMLDivElement, render_options?: RenderOptions): number; /** {en} * @brief Unbind the remote screen sharing stream from the view * @param user_id ID of the remote user * @param room_id Room ID * @returns + `0`: Success * + `-1`: Failure. * @notes Call this API after stopping receiving screen sharing. * @group Video Management * @order 11 */ /** {zh} * @brief 解绑远端屏幕共享流已绑定的本地视图 * @param user_id 远端用户 ID * @param room_id 房间 ID * @returns + `0`:成功 * + `-1`: 失败 * @notes 停止接收屏幕共享流时应解绑视图 * @group Video Management * @order 11 */ removeRemoteScreen(user_id: string, room_id: string): number; /** {en} * @brief Get local video stream * @param index Mainstream or screen-sharing stream. * @param required_format Video frame encoding format that applys to custom rendering. * @returns + `0`: Success * + `-1`: Failure. * @group Custom Stream Processing * @order 10 */ /** {zh} * @brief 获取本地视频流。 * @param index 视频流属性。采集的视频流/屏幕视频流 * @param required_format 适用的视频帧编码格式 * @returns + `0`:成功 * + `-1`: 失败 * @group Custom Stream Processing * @order 10 */ setLocalVideoSink(index: StreamIndex, required_format: PixelFormat): number; /** {en} * @brief Stop get local video stream * @param stream_index Mainstream or screen-sharing stream. * @returns + `0`: Success * + `-1`: Failure. * @group Custom Stream Processing * @order 11 */ /** {zh} * @brief 停止获取本地视频流。 * @param stream_index 视频流属性。采集的视频流/屏幕视频流 * @returns + `0`:成功 * + `-1`: 失败 * @group Custom Stream Processing * @order 11 */ unsetLocalVideoSink(stream_index: StreamIndex): number; /** {en} * @brief Get remote video stream * @param stream_key Remote stream information that specifies the source and type of the video stream. * @param required_format Video frame encoding format that applys to custom rendering. * @returns + `0`: Success * + `-1`: Failure. * @group Custom Stream Processing * @order 12 */ /** {zh} * @brief 获取远端视频流。 * @param stream_key 远端流信息,用于指定需要设置的视频流来源及属性。 * @param required_format 适用的视频帧编码格式 * @returns + `0`:成功 * + `-1`: 失败 * @group Custom Stream Processing * @order 12 */ setRemoteVideoSink(stream_key: RemoteStreamKey, required_format: PixelFormat): number; /** {en} * @brief Stop get remote video stream * @param stream_key Remote stream information that specifies the source and type of the video stream. * @returns + `0`: Success * + `-1`: Failure. * @group Custom Stream Processing * @order 13 */ /** {zh} * @brief 停止获取远端视频流。 * @param stream_key 远端流信息,用于指定需要设置的视频流来源及属性。 * @returns + `0`:成功 * + `-1`: 失败 * @group Custom Stream Processing * @order 14 */ unsetRemoteVideoSink(stream_key: RemoteStreamKey): number; /** {en} * @hidden * @brief Plays the music. * @param music_id Music ID. * If the song with the same music_id is playing when you call this API, the music will restart from the starting position. An error will be triggered if the audio file corresponding to music_id does not exist. * @param track_type Audio track type of the KTV player. * @param play_type Audio play type. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling this API, you will receive the music play state through [`onPlayStateChanged`](85533#onplaystatechanged) callback. * + If the music ID is invalid, you will receive the [`onplaystatechanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * + If the music file does not exist, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3020 and a play_state of 4. * @group KTV * @order 20 */ /** {zh} * @brief 播放歌曲。 * @param music_id 音乐 ID。 * 若同一 music_id 的歌曲正在播放,再次调用接口会从开始位置重新播放。若 music_id 对应的音频文件不存在会触发报错。 * @param track_type 原唱伴唱类型。 * @param play_type 音乐播放类型。 * @returns + `0`:成功 * + `-1`: 失败 * @notes + 调用接口后,你会收到 [`onPlayStateChanged`](85533#onplaystatechanged) 回调歌曲播放状态。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * + 若音乐文件不存在,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3020,play_state 为 4。 * @group KTV * @order 20 */ playMusic(music_id: string, track_type: AudioTrackType, play_type: AudioPlayType): number; /** {en} * @hidden * @brief Pauses the music. * @param music_id Music ID. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling this API, you will receive the music play state through [`onPlayStateChanged`](85533#onplaystatechanged) callback. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 21 */ /** {zh} * @brief 暂停播放歌曲。 * @param music_id 音乐 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用接口后,你会收到 [`onPlayStateChanged`](85533#onplaystatechanged) 回调歌曲播放状态。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 21 */ pauseMusic(music_id: string): number; /** {en} * @hidden * @brief Resumes playing the music. * @param music_id Music ID. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling this API, you will receive the music play state through [`onPlayStateChanged`](85533#onplaystatechanged) callback. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 22 */ /** {zh} * @brief 继续播放歌曲。 * @param music_id 音乐 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用接口后,你会收到 [`onPlayStateChanged`](85533#onplaystatechanged) 回调歌曲播放状态。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 22 */ resumeMusic(music_id: string): number; /** {en} * @hidden * @brief Stops playing the music. * @param music_id Music ID. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling this API, you will receive the music play state through [`onPlayStateChanged`](85533#onplaystatechanged) callback. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 24 */ /** {zh} * @brief 停止播放歌曲。 * @param music_id 音乐 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用接口后,你会收到 [`onPlayStateChanged`](85533#onplaystatechanged) 回调歌曲播放状态。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 24 */ stopMusic(music_id: string): number; /** {en} * @hidden * @brief Sets the starting position of the music file. * @param music_id Music ID. * @param position The starting position of the music file in milliseconds. The value must be less than the total length of the music. * @returns + `0`: Success * + `<0`: Failure. * @notes + The music must be playing when you call this API. * + After calling this API, you will receive the music play state through [`onPlayStateChanged`](85533#onplaystatechanged) callback. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 30 */ /** {zh} * @brief 设置音乐文件的起始播放位置。 * @param music_id 音乐 ID。 * @param position 音乐起始位置,单位为毫秒,取值小于音乐文件总时长。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用本接口时音乐必须处于播放中状态。 * + 调用接口后,你会收到 [`onPlayStateChanged`](85533#onplaystatechanged) 回调歌曲播放状态。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 30 */ seekMusic(music_id: string, position: number): number; /** {en} * @hidden * @brief Sets the volume of the playing music. The music must be playing when you set the volume. * @param music_id Music ID. * @param volume Volume. Adjustment range: [0,400]. * + `0`: Mute. * + `100`: Original volume. * + `400`: 4 times the original volume (with overflow protection). * @returns + `0`: Success * + `<0`: Failure. * @notes + The music must be playing when you call this API. * + If the set volume is greater than 400, it will be adjusted by the maximum value of 400; if the set volume is less than 0, it will be adjusted by the minimum value of 0. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 32 */ /** {zh} * @brief 设置歌曲播放音量,只能在开始播放后进行设置。 * @param music_id 音乐 ID。 * @param volume 歌曲播放音量,调节范围:[0,400]。 * + `0`:静音。 * + `100`:原始音量。 * + `400`: 原始音量的 4 倍(自带溢出保护)。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用本接口时音乐必须处于播放中状态。 * + 若设置的音量大于 400,则按最大值 400 进行调整;若设置的音量小于 0,则按最小值 0 进行调整。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 32 */ setMusicVolume(music_id: string, volume: number): number; /** {en} * @hidden * @brief Switches the audio track type between the original track and the instrumental track. * @param music_id Music ID. * @returns + `0`: Success * + `<0`: Failure. * @notes The music must be playing when you call this API. * @group KTV * @order 34 */ /** {zh} * @brief 切换歌曲原唱伴唱。 * @param music_id 音乐 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @notes 调用本接口时音乐必须处于播放中状态。 * @group KTV * @order 34 */ switchAudioTrackType(music_id: string): number; /** {en} * @hidden * @brief Transposes up/down the music being played. * @param music_id Music ID. * @param pitch The pitch up/down value relative to the original pitch, in the range of [-12, 12], with the default value of 0. * The difference in pitch between two adjacent values is a semitone. A positive value indicates an increase in pitch, and a negative value indicates a decrease in pitch. A larger absolute value means more pitch increase or decrease. * @returns + `0`: Success * + `<0`: Failure. * @notes + The music must be in the playing when you call this API. * + If the set pitch is greater than 12, it will be adjusted by the maximum value of 12; if the set pitch is less than –12, it will be adjusted by the minimum value of –12. * + If the music ID is invalid, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3023 and a play_state of 4. * + If you didn't join the room, you will receive the [`onPlayStateChanged`](85533#onplaystatechanged) callback, with an error_code of -3022 and a play_state of 4. * @group KTV * @order 36 */ /** {zh} * @brief 对播放中的音乐设置升降调信息。 * @param music_id 音乐 ID。 * @param pitch 相对于音乐文件原始音调的升高/降低值,取值范围 [-12,12],默认值为 0,即不做调整。 * 取值范围内每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调,设置的绝对值越大表示音调升高或降低越多。 * @returns + `0`:成功 * + `<0`: 失败 * @notes + 调用本接口时音乐必须处于播放中状态。 * + 若设置的 pitch 大于 12,则按最大值 12 进行调整;若设置的 pitch 小于 –12,,则按最小值 –12 进行调整。 * + 若音乐 ID 错误,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3023,play_state 为 4。 * + 若未进房,会触发 [`onPlayStateChanged`](85533#onplaystatechanged) 回调,error_code 为 –3022,play_state 为 4。 * @group KTV * @order 36 */ setMusicPitch(music_id: string, pitch: number): number; /** {en} * @hidden * @brief Sets the maximum cache for storing music files. * @param max_cache_size_MB The maximum cache to be set in MB. * If the setting value is less than or equal to 0, it will be adjusted to 1,024 MB. * @returns + `0`: Success * + `<0`: Failure. * @group KTV * @order 18 */ /** {zh} * @brief 设置歌曲文件最大占用的本地缓存。 * @param max_cache_size_MB 本地缓存,单位 MB。 * 设置值小于等于 0 时,使用默认值 1024 MB。 * @returns + `0`:成功 * + `<0`: 失败 * @group KTV * @order 18 */ setMaxCacheSize(max_cache_size_MB: number): number; /** {en} * @hidden * @brief Gets the music list. * @param page_num Page number. The default value is 1. * @param page_size The number of the music that displays on one page. * @param filters The filter type of the music list. Multiple filters can be combined by the bitwise-or operator. * + `0`: No filter. * + `1<<0`: Remove music that does not have lyrics. * + `1<<1`: Remove music that does not support scoring. * + `1<<2`: Remove music that does not support accompany mode. * + `1<<3`: Remove music that does not have a climax part. * @returns + `0`: Success * + `<0`: Failure. * @notes After calling this API, you will receive the music list through [onMusicListResult](85533#onmusiclistresult) callback. * @group KTV * @order 6 */ /** {zh} * @brief 获取歌曲列表。 * @param page_num 页码,默认从 1 开始。 * @param page_size 每页显示歌曲的最大数量,取值范围 [1,99]。 * @param filters 歌曲过滤方式。多个过滤方式可以按位或组合。 * + `0`: 不过滤。 * + `1<<0`: 过滤没有歌词的歌曲。 * + `1<<1`: 过滤不支持打分的歌曲。 * + `1<<2`: 过滤不支持伴唱切换的歌曲。 * + `1<<3`: 过滤没有高潮片段的歌曲。 * @returns + `0`:成功 * + `<0`: 失败 * @notes 调用接口后,你会收到 [onMusicListResult](85533#onmusiclistresult) 回调歌曲列表。 * @group KTV * @order 6 */ getMusicList(page_num: number, page_size: number, filters: number): number; /** {en} * @hidden * @brief Search music by keywords. * @param key_word Keyword. The string should be no more than 20 characters. * @param page_num Page number. The default value is 1. * @param page_size The number of the music that displays on one page. * @param filters The filter type of the music list. Multiple filters can be combined by the bitwise-or operator. * + `0`: No filter. * + `1<<0`: Remove music that does not have lyrics. * + `1<<1`: Remove music that does not support scoring. * + `1<<2`: Remove music that does not support accompany mode. * + `1<<3`: Remove music that does not have a climax part. * @returns + `0`: Success * + `<0`: Failure. * @notes After calling this API, you will receive the music list through [onSearchMusicResult](85533#onsearchmusicresult) callback. * @group KTV * @order 7 */ /** {zh} * @brief 根据关键词搜索歌曲。 * @param key_word 关键词,字符串长度最大为 20 个字符。 * @param page_num 页码,默认从 1 开始。 * @param page_size 每页显示歌曲的最大数量,取值范围 [1,99]。 * @param filters 歌曲过滤方式。多个过滤方式可以按位或组合。 * + `0`: 不过滤。 * + `1<<0`: 过滤没有歌词的歌曲。 * + `1<<1`: 过滤不支持打分的歌曲。 * + `1<<2`: 过滤不支持伴唱切换的歌曲。 * + `1<<3`: 过滤没有高潮片段的歌曲。 * @returns + `0`:成功 * + `<0`: 失败 * @notes 调用接口后,你会收到 [onSearchMusicResult](85533#onsearchmusicresult) 回调歌曲列表。 * @group KTV * @order 7 */ searchMusic(key_word: string, page_num: number, page_size: number, filters: number): number; /** {en} * @hidden * @brief Gets hot music according to music types. * @param hot_types Hot music type. Multiple hot music types can be combined by the bitwise-or operator. * + `1<<0`: Hot music in the content center. * + `1<<1`: Hot music of the project. * @param filters The filter type of the music list. Multiple filters can be combined by the bitwise-or operator. * + `0`: No filter. * + `1<<0`: Remove music that does not have lyrics. * + `1<<1`: Remove music that does not support scoring. * + `1<<2`: Remove music that does not support accompany mode. * + `1<<3`: Remove music that does not have a climax part. * @returns + `0`: Success * + `<0`: Failure. * @notes After calling this API, you will receive the music list through [onHotMusicResult](85533#onhotmusicresult) callback. * @group KTV * @order 8 */ /** {zh} * @brief 根据热榜类别获取每个榜单的歌曲列表。 * @param hot_types 热榜类别。多个热榜类别可以按位或组合。 * + `1<<0`: 火山内容中心热歌榜。 * + `1<<1`: 项目热歌榜。 * @param filters 歌曲过滤方式。多个过滤方式可以按位或组合。 * + `0`: 不过滤。 * + `1<<0`: 过滤没有歌词的歌曲。 * + `1<<1`: 过滤不支持打分的歌曲。 * + `1<<2`: 过滤不支持伴唱切换的歌曲。 * + `1<<3`: 过滤没有高潮片段的歌曲。 * @returns + `0`:成功 * + `<0`: 失败 * @notes 调用接口后,你会收到 [onHotMusicResult](85533#onhotmusicresult) 回调歌曲列表。 * @group KTV * @order 8 */ getHotMusic(hot_types: number, filters: number): number; /** {en} * @hidden * @brief Gets music detail. * @param music_id Music ID. * @returns + `0`: Success * + `<0`: Failure. * @notes After calling this API, you will receive the music detial through [onMusicDetailResult](85533#onmusicdetailresult) callback. * @group KTV * @order 5 */ /** {zh} * @brief 获取音乐详细信息。 * @param music_id 音乐 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @notes 调用接口后,你会收到 [onMusicDetailResult](85533#onmusicdetailresult) 回调。 * @group KTV * @order 5 */ getMusicDetail(music_id: string): number; /** {en} * @hidden * @brief Download music. * @param music_id Music ID. * @returns Download task ID. * @notes + If the music is successfully downloaded, you will receive [onDownloadSuccess](85533#ondownloadsuccess). * + If the music fails to download, you will receive [onDownloadFailed](85533#ondownloadfailed). * + When the music download progress is updated, you will receive onDownloadMusicProgress(85533#onDownloadMusicProgress). * @group KTV * @order 10 */ /** {zh} * @brief 下载音乐。 * @param music_id 音乐 ID。 * @returns 下载任务 ID。 * @notes + 若音乐下载成功,你会收到 [onDownloadSuccess](85533#ondownloadsuccess) 回调。 * + 若音乐下载失败,你会收到 [onDownloadFailed](85533#ondownloadfailed) 回调。 * + 音乐下载进度更新时,你会收到 onDownloadMusicProgress(85533#onDownloadMusicProgress) 回调。 * @group KTV * @order 10 */ downloadMusic(music_id: string): number; /** {en} * @hidden * @brief Download lyrics. * @param music_id Music ID. * @param type The lyrics file's format. * @returns Download task ID. * @notes + If the lyrics are successfully downloaded, you will receive [onDownloadSuccess](85533#ondownloadsuccess). * + If the lyrics fail to download, you will receive [onDownloadFailed](85533#ondownloadfailed). * @group KTV * @order 11 */ /** {zh} * @brief 下载歌词。 * @param music_id 音乐 ID。 * @param type 歌词文件类型。 * @returns 下载任务 ID。 * @notes + 若歌词下载成功,你会收到 [onDownloadSuccess](85533#ondownloadsuccess) 回调。 * + 若歌词下载失败,你会收到 [onDownloadFailed](85533#ondownloadfailed) 回调。 * @group KTV * @order 11 */ downloadLyric(music_id: string, type: DownloadLyricType): number; /** {en} * @hidden * @brief Download MIDI files. * @param music_id Music ID. * @returns Download task ID. * @notes + If the file is successfully downloaded, you will receive [onDownloadSuccess](85533#ondownloadsuccess). * + If the file fails to download, you will receive [onDownloadFailed](85533#ondownloadfailed). * @group KTV * @order 12 */ /** {zh} * @brief 下载 MIDI 文件。 * @param music_id 音乐 ID。 * @returns 下载任务 ID。 * @notes + 若文件下载成功,你会收到 [onDownloadSuccess](85533#ondownloadsuccess) 回调。 * + 若文件下载失败,你会收到 [onDownloadFailed](85533#ondownloadfailed) 回调。 * @group KTV * @order 12 */ downloadMidi(music_id: string): number; /** {en} * @hidden * @brief Cancels download task. * @param download_id Download task ID. * @returns + `0`: Success * + `<0`: Failure. * @group KTV * @order 13 */ /** {zh} * @brief 取消下载任务。 * @param download_id 下载任务 ID。 * @returns + `0`:成功 * + `<0`: 失败 * @group KTV * @order 13 */ cancelDownload(download_id: number): number; /** {en} * @hidden * @brief Clear music cache, including music and lyrics. * @returns 0:成功 * -1: 失败 * @group KTV * @order 19 */ /** {zh} * @brief 清除当前音乐缓存文件,包括音乐音频和歌词。 * @returns + `0`: Success * + `<0`: Failure. * @group KTV * @order 19 */ clearCache(): number; /** {en} * @hidden * @brief Initialize karaoke scoring feature. * @param sing_scoring_appkey The key for karaoke scoring, used to authenticate whether the karaoke scoring is enabled. * @param sing_scoring_token The key for karaoke scoring, used to authenticate whether the karaoke scoring is enabled. * @notes Enter two keys to enable karaoke scoring. Authentication is done offline, bind the Appkey and Token according to the package name (bundleID). Please contact technical support to apply for the key. * @returns + `0`: Success * + `<0`: Failure. * @group KTV * @order 70 */ /** {zh} * @brief 初始化 K 歌评分。 * @param sing_scoring_appkey K 歌评分密钥,用于鉴权验证 K 歌功能是否开通。 * @param sing_scoring_token K 歌评分密钥,用于鉴权验证 K 歌功能是否开通。 * @notes 输入正确的鉴权信息才可以使用 K 歌评分相关的功能,鉴权方式为离线鉴权,根据包名(bundleID)绑定 Appkey 及 Token,K 歌评分密钥请联系技术支持同学申请。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @group KTV * @order 70 */ initSingScoring(sing_scoring_appkey: string, sing_scoring_token: string): number; /** {en} * @hidden * @brief Set the configuration of karaoke scoring. * @param config The parameters of karaoke scoring. * @returns + `0`:Success. * + `-1`:Interface call failed. * + `-2`: Karaoke scoring module not integrated. * @group KTV * @order 71 */ /** {zh} * @brief 设置 K 歌评分参数。 * @param config K 歌评分的各项参数 * @returns + `0`:配置成功。 * + `-1`:接口调用失败。 * + `-2`:未集成 K 歌评分模块。 * @group KTV * @order 71 */ setSingScoringConfig(config: SingScoringConfig): number; /** {en} * @brief Get the number of audio & video devices in the current system. * @returns Number of audio & video devices * @group KTV * @order 72 */ /** {zh} * @brief 获取当前系统内音视频设备数量 * @returns 音视频设备数量 * @group KTV * @order 72 */ getStandardPitchCount(): any; /** {en} * @brief Get the standard pitch information of each lyric. * @param index Number of lines, of which the range is from 0 to the total number of lines obtained by calling [getStandardPitchCount](85532#rtcvideo-getstandardpitchcount) minus 1. * @returns Standard pitch information of each lyric * @group KTV * @order 73 */ /** {zh} * @brief 获取每句歌词的标准音高信息 * @param index 歌词句子数,取值范围为 0 到调用 [getStandardPitchCount](85532#rtcvideo-getstandardpitchcount) 获取到的句子总数减 1。 * @returns 标准音高数据 * @group KTV * @order 73 */ getStandardPitchInfo(index: number): StandardPitchInfo; /** {en} * @hidden * @brief Start karaoke scoring. * @param position You can get the playback position where you start karaoke scoring. Unit: ms. * @param scoring_info_interval Time interval between two real-time callbacks. Unit: ms; Default interval: 50 ms. Minimum interval: 20 ms. * @returns + `0`: Success * + `<0`: Failure. * @notes + You can call this API after calling [initSingScoring](#initsingscoring) to initialize karaoke scoring. * + After this interface is called, you will receive the scoring result [onCurrentScoringInfo](85533#oncurrentscoringinfo) at set interval. * + If you call the [startAudioMixing](#startaudiomixing) to play an audio file, call this interface after you receive [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)(AUDIO_MIXING_STATE_PLAYING(1)). * @group KTV * @order 74 */ /** {zh} * @brief 开始 K 歌评分。 * @param position 开始评分时,音乐的播放进度,单位:ms。 * @param scoring_info_interval 实时回调的时间间隔,单位:ms;默认 50 ms。最低间隔为 20 ms。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes + 在调用 [initSingScoring](#initsingscoring) 初始化 K 歌评分功能后调用该接口。 * + 调用该接口后,将会根据设置的回调时间间隔,收到评分结果 [onCurrentScoringInfo](85533#oncurrentscoringinfo) 回调。 * + 如果调用 [startAudioMixing](#startaudiomixing) 接口播放音频文件,请在收到 [onAudioMixingStateChanged](85533#onaudiomixingstatechanged)(AUDIO_MIXING_STATE_PLAYING(1)) 之后调用此接口。 * @group KTV * @order 74 */ startSingScoring(position: number, scoring_info_interval: number): any; /** {en} * @hidden * @brief Stop karaoke scoring. * @returns + `0`: Success * + `<0`: Failure. * @group KTV * @order 80 */ /** {zh} * @brief 停止 K 歌评分。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @group KTV * @order 80 */ stopSingScoring(): number; /** {en} * @hidden * @brief Get the score for the previous lyric. * @returns + `<0`:Failed to get the score for the previous lyric. * + `>=0`:The score for the previous lyric. * @notes You can call this API after [startSingScoring](#startsingscoring) is called. * @group KTV * @order 75 */ /** {zh} * @brief 获取上一句的演唱评分。 * @return+ `<0`:获取评分失败。 * + `>=0`:上一句歌词的演唱评分。 * @notes 调用 [startSingScoring](#startsingscoring) 开始评分后可以调用该接口。 * @group KTV * @order 75 */ getLastSentenceScore(): number; /** {en} * @hidden * @brief Get the total score for the user's current performance. * @returns + <0:Failed to get the total score. * + >=0:The current total score. * @notes You can call this API after [startSingScoring](#startsingscoring) is called. * @group KTV * @order 76 */ /** {zh} * @brief 获取当前演唱总分。 * @returns + `<0`:获取总分失败。 * + `>=0`:当前演唱总分。 * @notes 调用 [startSingScoring](#startsingscoring) 开始评分后可以调用该接口。 * @group KTV * @order 76 */ getTotalScore(): number; /** {en} * @hidden * @brief Get the average score for the user's current performance. * @returns + `<0`:Failed to get the average score. * + `>=0`:The average score. * @group KTV * @order 77 */ /** {zh} * @brief 获取当前演唱歌曲的平均分。 * @returns + `<0`:获取平均分失败。 * + `>=0`:当前演唱平均分。 * @group KTV * @order 77 */ getAverageScore(): number; /** {en} * @brief Set the equalization effect for the local captured audio. The audio includes both internal captured audio and external captured voice, but not the mixing audio file. * @param config Voice equalization config * @returns + `0`: Success * + `<0`: Failure. * @notes According to the Nyquist acquisition rate, the audio acquisition rate must be greater than twice the set center frequency. Otherwise, the setting will not be effective. * @group Audio Processing * @order 30 */ /** {zh} * @brief 设置本地采集语音的均衡效果。包含内部采集和外部采集,但不包含混音音频文件。 * @param config 语音均衡效果 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes 根据奈奎斯特采样率,音频采样率必须大于等于设置的中心频率的两倍,否则,设置不生效。 * @group Audio Processing * @order 30 */ setLocalVoiceEqualization(config: VoiceEqualizationConfig): number; /** {en} * @brief Set the equalization effect for the local captured audio. The audio includes both internal captured audio and external captured voice, but not the mixing audio file. * @param param Equalization settings * @returns + `0`: Success. * + `<0`: Failure. * @group Audio Processing * @order 20 */ /** {zh} * @brief 设置本地采集音频的混响效果。包含内部采集和外部采集,但不包含混音音频文件。 * @param param 混响效果 * @returns + `0`: 成功。 * + `<0`: 失败。 * @group Audio Processing * @order 20 * @notes 根据奈奎斯特采样率,音频采样率必须大于等于设置的中心频率的两倍,否则,设置不生效。 */ setLocalVoiceReverbParam(param?: VoiceReverbConfig): number; /** {en} * @brief Enable the reverb effect for the local captured voice. * @param enable * @returns + `0`: Success. * + `<0`: Failure. * @notes Call [setLocalVoiceReverbParam](#setlocalvoicereverbparam) to set the reverb effect. * @group Audio Processing * @order 25 */ /** {zh} * @brief 开启本地音效混响效果 * @param enable 是否开启 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes 调用 [setLocalVoiceReverbParam](#setlocalvoicereverbparam) 设置混响效果。 * @group Audio Processing * @order 25 */ enableLocalVoiceReverb(enable: boolean): number; /** {en} * @brief Start recording audio communication, and generate the local file. * @param config Recording configuration * @returns + `0`: `kReturnStatusSuccess`: Success * + `-2`: `kReturnStatusParameterErr`: Invalid parameters * + `-3`: `kReturnStatusWrongState`: Not valid in this SDK. Please contact the technical support. * @notes + All audio effects are valid in the file. Mixed audio file is not included in the file. * + Call [stopAudioRecording](#stopaudiorecording) to stop recording. * + Call this API after joining the room. If you join multiple rooms, audio from all rooms are recorded in one file. After you leave the last room, the recording task ends automatically. * + After calling the API, you'll receive onAudioRecordingStateUpdate(85533#onaudiorecordingstateupdate). * @group Recording * @order 4 */ /** {zh} * @brief 开启录制语音通话,生成本地文件。 * @param config 录制参数 * @returns + `0`: 正常 * + `-2`: 参数设置异常 * + `-3`: 当前版本 SDK 不支持该特性,请联系技术支持人员 * @notes + 录制包含各种音频效果。但不包含背景音乐。 * + 调用 [stopAudioRecording](#stopaudiorecording) 关闭录制。 * + 加入房间后才可调用。如果加入了多个房间,录制的文件中会包含各个房间的音频。离开最后一个房间后,录制任务自动停止。 * + 调用该方法后,你会收到 onAudioRecordingStateUpdate(85533#onaudiorecordingstateupdate) 回调。 * @group Recording * @order 4 */ startAudioRecording(config: AudioRecordingConfig): number; /** {en} * @brief Stop audio recording. * @returns + `0`: Success * + `<0`: Failure. * @notes Call [startAudioRecording](#startaudiorecording) to start the recording task. * @group Recording * @order 5 */ /** {zh} * @brief 停止音频文件录制 * @return * + 0: 正常 * + -3: 当前版本 SDK 不支持该特性,请联系技术支持人员 * @notes 调用 [startAudioRecording](#startaudiorecording) 开启本地录制。 * @group Recording * @order 5 */ stopAudioRecording(): number; /** {en} * @brief Enables/disables the silent device filter function. * @param enabe Whether to enable the silent device filter function: * + 1: true * + 0: false * @returns + `0`: Success * + `<0`: Failure. * @group Audio Management * @order 14 */ /** {zh} * @brief 开启/关闭过滤无声设备功能。 * @param enable 是否开启过滤无声设备功能: * + 1: 是 * + 0: 否 * @returns + `0`: 成功。 * + `<0`: 失败。 * @group Audio Management * @order 14 */ enableFilterSilentDevice(enable: boolean): number; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Stop playing all audio files and mixes. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling [startAudioMixing](#startaudiomixing) to play audio files and mixes, you can call this api to stop playing all the files. * + After calling this api to stop playing all audio and mixes, you will receive `onAudioMixingStateChanged` callback to inform you that the playing and mixing has been stopped. * + After you call this api to stop playing all audio and mixes, the files will be automatically uninstalled. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 停止播放所有音频文件及混音。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes * + 调用 [startAudioMixing](#startaudiomixing) 方法开始播放音频文件及混音后,可以调用本方法停止播放所有音频文件及混音。 * + 调用本方法停止播放所有音频文件及混音后,会收到 `onAudioMixingStateChanged` 回调,通知已停止播放和混音。 * + 调用本方法停止播放所有音频文件及混音后,该音频文件会被自动卸载。 */ stopAllAudioMixing(): any; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Pause all audio files and mixes. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling [startAudioMixing](#startaudiomixing) to play audio files and mixes, you can call this api to pause all the files. * + After calling this api to pause all audio and mixes, you can call [resumeAllAudioMixing](#resumeallaudiomixing) to resume the playing and mixing. * + After calling this api to pause all audio and mixes, you will receive `onAudioMixingStateChanged` callback to inform you that the playing and mixing has been paused. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 暂停播放所有音频文件及混音。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes + 调用 [startAudioMixing](#startaudiomixing) 方法开始播放音频文件及混音后,可以通过调用本方法暂停播放所有音频文件及混音。 * + 调用本方法暂停播放所有音频文件及混音后,可调用 [resumeAllAudioMixing](#resumeallaudiomixing) 方法恢复所有播放及混音。 * + 调用本方法暂停播放所有音频文件及混音后,会收到 `onAudioMixingStateChanged` 回调,通知已暂停播放和混音。 */ pauseAllAudioMixing(): any; /** {en} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief Resume playing all audio files and mixes. * @returns + `0`: Success * + `<0`: Failure. * @notes + After calling [pauseAllAudioMixing](#pauseallaudiomixing) , you can call this api to resume playing all the files. * + After calling this api to resume all audio and mixes, you will receive `onAudioMixingStateChanged` callback to inform you that the playing and mixing has been resumed. */ /** {zh} * @deprecated since 325.1, use RTCMediaPlayer and RTCAudioEffectPlayer instead. * @brief 恢复播放所有音频文件及混音。 * @returns + `0`: 成功。 * + `<0`: 失败。 * @notes + 调用 [pauseAllAudioMixing](#pauseallaudiomixing) 方法暂停所有正在播放音频文件及混音后,可以通过调用本方法恢复播放及混音。 * + 调用本方法恢复播放所有音频文件及混音后,会收到 `onAudioMixingStateChanged` 回调,通知已恢复播放和混音。 */ resumeAllAudioMixing(): any; /** {en} * @brief Turns on/ off AGC(Analog Automatic Gain Control). After AGC is enabled, SDK can automatically adjust mircrophone pockup volume to keep the output volume at a steady level. * @param enable whether to turn on AGC. * + true: AGC is turned on. * + false: AGC is turned off. * @returns + 0: Success. * + -1: Failure. * @notes + You can call this method before and after joining the room. To turn on AGC before joining the room, you need to contact the technical support to get a private parameter to set [RoomProfileType](85535#roomprofiletype). * + To enable AGC after joining the room, you must set [RoomProfileType](85535#roomprofiletype) to `kRoomProfileTypeMeeting`, `kRoomProfileTypeMeetingRoom` or `kRoomProfileTypeClassroom`. * + It is not recommended to call [setAudioCaptureDeviceVolume](85532#rtcvideo-setaudiocapturedevicevolume) to adjust microphone pickup volume with AGC on. * @group Audio Management * @order 89 */ /** {zh} * @brief 打开/关闭 AGC(Automatic Gain Control) 自动增益控制功能。开启该功能后,SDK 会自动调节麦克风的采集音量,确保音量稳定。 * @param enable 是否打开 AGC 功能: * + true: 打开 AGC 功能。 * + false: 关闭 AGC 功能。 * @returns + 0: 调用成功。 * + -1: 调用失败。 * @notes + 该方法在进房前后均可调用。如果你需要在进房前使用 AGC 功能,请联系技术支持获得私有参数,传入对应 [`RoomProfileType`](85535#roomprofiletype)。 * + 要想在进房后开启 AGC 功能,你需要把 [`RoomProfileType`](85535#roomprofiletype) 设置为 `kRoomProfileTypeMeeting` 、`kRoomProfileTypeMeetingRoom` 或 `kRoomProfileTypeClassroom` 。 * + AGC 功能生效后,不建议再调用 [`setAudioCaptureDeviceVolume`](85532#rtcvideo-setaudiocapturedevicevolume) 来调节设备麦克风的采集音量。 * @group Audio Management * @order 89 */ enableAGC(enable: boolean): number; /** {en} * @brief Set the rotation of the local video images. Call this API to rotate the videos when the camera is fixed upside down or tilted. * @param rotation It defaults to `VIDEO_ROTATION_0(0)`, which means not to rotate. * @notes + This API affects the external-sourced videos. The final rotation would be the original rotation angles adding up with the rotation set by calling this API. * + This API would not rotate the background added by calling [enableVirtualBackground](85532#rtcvideo-enablevirtualbackground). * + The rotation would not be applied to the Stream pushed to CDN. * @group Video Processing * @order 21 */ /** {zh} * @brief 设置本端采集的视频帧的旋转角度。当外接摄像头倒置或者倾斜安装时,调用本接口进行调整。 * @param rotation 相机朝向角度,默认为 `VIDEO_ROTATION_0(0)`,无旋转角度。 * @notes + 调用本接口也将对自定义采集视频画面生效,在原有的旋转角度基础上叠加本次设置。 * + 通过 [enableVirtualBackground](85532#rtcvideo-enablevirtualbackground) 增加的虚拟背景,不会跟随本接口的设置进行旋转。 * + 通过本接口设置的旋转角度不会应用到转推直播中。 * @group Video Processing * @order 21 */ setVideoCaptureRotation(rotation: VideoRotation): number; /** {en} * @brief Set the step size for each digital zooming control to the local videos. * @param type Required. Identifying which type the `size` is referring to. * @param size Required. Reserved to three decimal places. It defaults to `0`. * The meaning and range vary from different `type`s. If the scale or moving distance exceeds the range, the limit is taken as the result. * + `kZoomFocusOffset`: Increasement or decrease to the scaling factor. Range: [0, 7]. For example, when it is set to 0.5 and [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) is called to zoom in, the scale will increase `0.5`. The scale ranges [1,8] and defaults to `1`, which means an original size. * + `kZoomMoveOffset`:Ratio of the distance to the border of video images. It ranges [0, 0.5] and defaults to `0`, which means no offset. When you call [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) and choose `CAMERA_MOVE_LEFT`, the moving distance is size x original width. While for the `CAMERA_MOVE_UP`, the moving distance is size x original height. Suppose that a video spans 1080 px and the `size` is set to `0.5` so that the distance would be 0.5 x 1080 px = 540 px. * @notes + Only one size can be set for a single call. You must call this API to pass values respectively if you intend to set multiple `size`s. * + As the default `size` is `0`, you must call this API before performing any digital zoom control by calling [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) or [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol). * @group Video Processing * @order 22 */ /** {zh} * @brief 设置本地摄像头数码变焦参数,包括缩放倍数,移动步长。 * @param type 数码变焦参数类型,缩放系数或移动步长。必填。 * @param size 缩放系数或移动步长,保留到小数点后三位。默认值为 0。必填。 * 选择不同 `type` 时有不同的取值范围。当计算后的结果超过缩放和移动边界时,取临界值。 * + `kZoomFocusOffset`:缩放系数增量,范围为 [0, 7]。例如,设置为 0.5 时,如果调用 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 选择 Zoom in,则缩放系数增加 0.5。缩放系数范围 [1,8],默认为 `1`,原始大小。 * + `kZoomMoveOffset`:移动百分比,范围为 [0, 0.5],默认为 0,不移动。如果调用 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 选择的是左右移动,则移动距离为 size x 原始视频宽度;如果选择的是上下移动,则移动距离为 size x 原始视频高度。例如,视频帧边长为 1080 px,设置为 0.5 时,实际移动距离为 0.5 x 1080 px = 540 px。 * @notes + 每次调用本接口只能设置一种参数。如果缩放系数和移动步长都需要设置,分别调用本接口传入相应参数。 * + 由于移动步长的默认值为 `0` ,在调用 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 或 [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol) 进行数码变焦操作前,应先调用本接口。 * @group Video Processing * @order 22 */ setVideoDigitalZoomConfig(type: ZoomConfigType, size: number): number; /** {en} * @brief Digital zoom or move the local video image once. This action affects both the video preview locally and the stream published. * @param direction Action of the digital zoom control. * @notes + As the default offset is `0`, you must call [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) before this API. * + You can only move video images after they are magnified via this API or [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol). * + When you request an out-of-range scale or movement, SDK will execute it with the limits. For example, when the image has been moved to the border, the image cannot be zoomed out, or has been magnified to 8x. * + Call [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol) to have a continuous and repeatedly digital zoom control. * @group Video Processing * @order 23 */ /** {zh} * @brief 控制本地摄像头数码变焦,缩放或移动一次。设置对本地预览画面和发布到远端的视频都生效。 * @param direction 数码变焦操作类型。 * @notes + 由于默认步长为 `0`,调用该方法前需通过 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 设置参数。 * + 调用该方法进行移动前,应先使用本方法或 [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol) 进行放大,否则无法移动。 * + 当数码变焦操作超出范围时,将置为临界值。例如,移动到了图片边界、放大到了 8 倍、缩小到原图大小。 * + 如果你希望实现持续数码变焦操作,调用 [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol)。 * @group Video Processing * @order 23 */ setVideoDigitalZoomControl(direction: ZoomDirectionType): number; /** {en} * @brief Continuous and repeatedly digital zoom control. This action effect both the video preview locally and the stream published. * @param direction Action of the digital zoom control. * @notes * + As the default offset is `0`, you must call [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) before this API. * + You can only move video images after they are magnified via this API or [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol). * + The control process stops when the scale reaches the limit, or the images have been moved to the border. if the next action exceeds the scale or movement range, SDK will execute it with the limits. * + Call [stopVideoDigitalZoomControl](85532#rtcvideo-stopvideodigitalzoomcontrol) to stop the ongoing zoom control. * + Call [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) to have a one-time digital zoom control. * @group Video Processing * @order 24 */ /** {zh} * @brief 开启本地摄像头持续数码变焦,缩放或移动。设置对本地预览画面和发布到远端的视频都生效。 * @param direction 数码变焦操作类型。 * @notes + 由于默认步长为 `0`,调用该方法前需通过 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 设置参数。 * + 调用该方法进行移动前,应先使用本方法或 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol) 进行放大,否则无法移动。 * + 当数码变焦操作超出范围时,将置为临界值并停止操作。例如,移动到了图片边界、放大到了 8 倍、缩小到原图大小。 * + 你也可以调用 [stopVideoDigitalZoomControl](85532#rtcvideo-stopvideodigitalzoomcontrol) 手动停止控制。 * + 如果你希望实现单次数码变焦操作,调用 [setVideoDigitalZoomControl](85532#rtcvideo-setvideodigitalzoomcontrol)。 * @group Video Processing * @order 24 */ startVideoDigitalZoomControl(direction: ZoomDirectionType): number; /** {en} * @brief Stop the ongoing digital zoom control instantly. * @notes Refer to [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol) for starting digital zooming. * @group Video Processing * @order 83 */ /** {zh} * @brief 停止本地摄像头持续数码变焦。 * @notes 关于开始数码变焦,参看 [startVideoDigitalZoomControl](85532#rtcvideo-startvideodigitalzoomcontrol)。 * @group Video Processing * @order 83 */ stopVideoDigitalZoomControl(): number; /** {en} * @brief Create a new task of pushing media streams to CDN and sets the relevant configurations. * @param task_id Task ID. The length should not exceed 126 bytes. * You may want to push more than one mixed stream to CDN from the same room. When you do that, use different ID for corresponding tasks; if you will start only one task, use an empty string. * @param config Configurations to be set when pushing streams to CDN. * @returns + 0: Success * + !0: Failure * @notes + When pushing more than one live streams in the same task, SDK will first mix those streams into one single stream and then push it to CDN. * + After calling this API, you will be informed of the result and errors during the pushing process via the [onSetRoomExtraInfoResult](85533#rtcroomcallback-onsetroomextrainforesult) callback. * + If you have subscribed the push-to-CDN callback in the [console](https://console.byteplus.com/rtc/cloudRTC?tab=callback), calling this API will receive a [TranscodeStarted](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodestarted) server callback notification. When calling this API repeatedly, the second call will trigger both [TranscodeStarted](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodestarted) and [TranscodeUpdated](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodeupdated) callbacks. If the audio/video encoding parameters of the second call are different, [TranscodeStateChanged](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodestatechanged) callback will also be triggered. * + Call [stopPushStreamToCDN](85532#rtcvideo-stoppushstreamtocdn) to stop pushing streams to CDN. * @group Push to CDN * @order 0 */ /** {zh} * @brief 新增转推直播任务(新),并设置合流的图片、视频视图布局和音频属性。 * @param task_id 转推直播任务 ID,长度不超过 126 字节。 * 你可以在同一房间内发起多个转推直播任务,并用不同的任务 ID 加以区分。当你需要发起多个转推直播任务时,应使用多个 ID;当你仅需发起一个转推直播任务时,建议使用空字符串。 * @param config 转推直播配置参数。 * @returns * + 0: 成功 * + !0: 失败 * @notes + 同一个任务中转推多路直播流时,SDK 会先将多路流合成一路流,然后再进行转推。 * + 调用该方法后,关于启动结果和推流过程中的错误,会收到 [onSetRoomExtraInfoResult](85533#rtcroomcallback-onsetroomextrainforesult) 回调。 * + 如果你在[控制台](https://console.volcengine.com/rtc/cloudRTC?tab=callback)配置了转推直播回调,调用本接口会收到 [TranscodeStarted](https://www.volcengine.com/docs/6348/75125#transcodestarted) 服务端的回调通知。重复调用该接口时,第二次调用会同时触发 [TranscodeStarted](https://www.volcengine.com/docs/6348/75125#transcodestarted) 和 [TranscodeUpdated](https://www.volcengine.com/docs/6348/75125#transcodeupdated) ,如果第二次调用的参数不同,还会触发 [TranscodeStateChanged](https://www.volcengine.com/docs/6348/75125#transcodestatechanged)。 * + 调用 [stopPushStreamToCDN](85532#rtcvideo-stoppushstreamtocdn) 停止转推直播。 * @group Push to CDN * @order 0 */ startPushMixedStreamToCDN(task_id: string, config: IMixedStreamConfig): number; private defaultMixedStreamConfig; /** {en} * @brief Update parameters needed when pushing media streams to CDN. * @param task_id Task ID. Specifys of which pushing task you want to update the parameters. * @param config Configurations that you want to update. Configurations that cannot be updated are specified in the description. * @return+ 0: Success * + !0: Failure * @notes + You will be informed of the change via the [onSetRoomExtraInfoResult](85533#rtcroomcallback-onsetroomextrainforesult) callback. * + After calling [startPushMixedStreamToCDN](#rtcvideo-startpushmixedstreamtocdn) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations. * @group Push to CDN * @order 1 */ /** {zh} * @brief 更新转推直播参数。 * @param task_id 转推直播任务 ID。指定想要更新参数设置的转推直播任务。 * @param config 转推直播配置参数。除特殊说明外,均支持过程中更新。 * @returns + 0: 成功 * + !0: 失败 * @notes + 会收到 [`onSetRoomExtraInfoResult`](85533#rtcroomcallback-onsetroomextrainforesult) 回调。 * + 使用 [`startPushMixedStreamToCDN`](85532#rtcvideo-startpushmixedstreamtocdn) 启用转推直播功能后,使用此方法更新功能配置参数。 * @group Push to CDN * @order 1 */ updatePushMixedStreamToCDN(task_id: string, config: IMixedStreamConfig): number; /** {en} * @brief Assign a internal render view to the mixed stream. * @param task_id task ID * @param view View * @param renderOptions Render options * @returns + `0`: Success * + `-1`: Failure. * @notes + Call this API to when you called [startPushMixedStreamToCDN](#rtcvideo-startpushmixedstreamtocdn). * + Call [`removeMixingVideo`](#removemixingvideo) to unbind. * @group Push to CDN * @order 3 */ /** {zh} * @brief 为客户端合流绑定本地视图 * @param task_id task ID * @param view 视图 * @param renderOptions 渲染选项 * @returns + `0`:成功 * + `-1`: 失败 * @notes + 使用客户端合流功能时,调用 [`startPushMixedStreamToCDN`](#rtcvideo-startpushmixedstreamtocdn) 后,调用本 API 绑定。 * + 如果需要解除绑定,调用 [`removeMixingVideo`](#removemixingvideo)。 * @group Push to CDN * @order 3 */ setupMixingVideo(task_id: string, view: HTMLDivElement, renderOptions?: RenderOptions): number; /** {en} * @brief Unbind the mixed stream from the view * @param task_id task ID * @returns + `0`: Success * + `-1`: Failure. * @notes Call this API after stopping pushing a mixed stream to CDN. * @group Push to CDN * @order 4 */ /** {zh} * @brief 为合流转推解绑本地视图 * @param task_id task ID * @returns + `0`:成功 * + `-1`: 失败 * @notes 停止接收合流转推时解绑视图。 * @group Push to CDN * @order 4 */ removeMixingVideo(task_id: string): number; /** {en} * @hidden * @brief Set the audio playback volume of the public stream. * @param public_stream_id ID of the public stream. * @param volume Ratio(%) of the audio playback volume to the original volume, in the range `[0, 400]`, with overflow protection. The default volume is 100. * To ensure the audio quality, the recommended range is `[0, 100]`. * @returns + 0: Success. * + -2: Wrong parameter. * @group Public Stream * @order 10 */ /** {zh} * @brief 调节公共流的音频播放音量。 * @param public_stream_id 公共流 ID * @param volume 音频播放音量值和原始音量值的比值,该比值的范围是 `[0, 400]`,单位为 %,且自带溢出保护。为保证更好的音频质量,建议设定在 `[0, 100]` 之间,其中 100 为系统默认值。 * @returns + 0: 成功调用。 * + -2: 参数错误。 * @group Public Stream * @order 10 */ setPublicStreamAudioPlaybackVolume(public_stream_id: string, volume: number): number; /** {en} * @brief Start echo detection before joining a room. * @param test_audio_file_path Absolute path of the music file for the detection. It is expected to encode with UTF-8. The following files are supported: mp3, aac, m4a, 3gp, wav. * We recommend to assign a music file whose duration is between 10 to 20 seconds. * Do not pass a Silent file. * @returns Method call result: * + 0: Success. * + -1: Failure due to the onging process of the previous detection. Call [stopHardwareEchoDetection](85532#rtcvideo-stophardwareechodetection) to stop it before calling this API again. * + -2: Failure due to an invalid file path or file format. * @notes + You can use this feature only when `RoomProfileType` is set to `kRoomProfileTypeMeeting` or `kRoomProfileTypeMeetingRoom`. * + Before calling this API, ask the user for the permissions to access the local audio devices. * + Before calling this api, make sure the audio devices are activate and keep the capture volume and the playback volume within a reasonable range. * + The detection result is passed as the argument of [onHardwareEchoDetectionResult](85533#rtcvideocallback-onhardwareechodetectionresult). * + During the detection, the SDK is not able to response to the other testing APIs, such as [startEchoTest](85532#rtcvideo-startechotest) or [startAudioPlaybackDeviceTest](85532#rtcvideo-startaudioplaybackdevicetest). * + Call [stopHardwareEchoDetection](85532#rtcvideo-stophardwareechodetection) to stop the detection and release the audio devices. * @group Audio Management * @order 91 */ /** {zh} * @brief 开启通话前回声检测 * @param test_audio_file_path 用于回声检测的音频文件的绝对路径,路径字符串使用 UTF-8 编码格式,支持以下音频格式: mp3,aac,m4a,3gp,wav。 * 音频文件不为静音文件,推荐时长为 10 ~ 20 秒。 * @returns 方法调用结果: * + 0: 成功。 * + -1:失败。上一次检测未结束,请先调用 [stopHardwareEchoDetection](85532#rtcvideo-stophardwareechodetection) 停止检测 后重新调用本接口。 * + -2:失败。路径不合法或音频文件格式不支持。 * @notes + 只有当 `RoomProfileType` 为 `kRoomProfileTypeMeeting` 和 `kRoomProfileTypeMeetingRoom` 时支持开启本功能。 * + 开启检测前,你需要向用户获取音频设备的使用权限。 * + 开启检测前,请确保音频设备没有被静音,采集和播放音量正常。 * + 调用本接口后监听 [`onHardwareEchoDetectionResult`](85533#rtcvideocallback-onhardwareechodetectionresult) 获取检测结果。 * + 检测期间,进程将独占音频设备,无法使用其他音频设备测试接口: [`startEchoTest`](85532#rtcvideo-startechotest) 或 [`startAudioPlaybackDeviceTest`](85532#rtcvideo-startaudioplaybackdevicetest)。 * + 调用 [`stopHardwareEchoDetection`](85532#rtcvideo-stophardwareechodetection) 停止检测,释放对音频设备的占用。 * @group Audio Management * @order 91 */ startHardwareEchoDetection(test_audio_file_path: string): number; /** {en} * @brief Stop the echo detection before joining a room. * @returns Method call result: * + 0: Success. * + -1: Failure. * @notes + Refer to [startHardwareEchoDetection](85532#rtcvideo-starthardwareechodetection) for information on how to start a echo detection. * + We recommend calling this API to stop the detection once getting the detection result from [onHardwareEchoDetectionResult](85533#rtcvideocallback-onhardwareechodetectionresult). * + You must stop the echo detection to release the audio devices before the user joins a room. Otherwise, the detection may interfere with the call. * @group Audio Management * @order 92 */ /** {zh} * @brief 停止通话前回声检测 * @returns 方法调用结果: * + 0: 成功。 * + -1:失败。 * @notes + 关于开启通话前回声检测,参看 [startHardwareEchoDetection](85532#rtcvideo-starthardwareechodetection) 。 * + 建议在收到 [onHardwareEchoDetectionResult](85533#rtcvideocallback-onhardwareechodetectionresult) 通知的检测结果后,调用本接口停止检测。 * + 在用户进入房间前结束回声检测,释放对音频设备的占用,以免影响正常通话。 * @group Audio Management * @order 92 */ stopHardwareEchoDetection(): number; /** {en} * @brief Sets local proxy. * @param configurations Local proxy configurations. * You can set both Http tunnel and Socks5 as your local proxies, or only set one of them based on your needs. If you set both Http tunnel and Socks5 as your local proxies, then media traffic and signaling are routed through Socks5 proxy and Http requests through Http tunnel proxy. If you set either Http tunnel or Socks5 as your local proxy, then media traffic, signaling and Http requests are all routed through the proxy you chose. * If you want to remove the existing local proxy configurations, you can call this API with the parameter set to null. * @notes + You must call this API before joining the room. * + After calling this API, you will receive [onLocalProxyStateChanged](85533#rtcvideocallback-onlocalproxystatechanged) callback that informs you of the states of local proxy connection. * @group Security and Encryption * @order 10 */ /** {zh} * @brief 设置本地代理。 * @param configurations 本地代理配置参数。 * 你可以根据自己的需要选择同时设置 Http 隧道 和 Socks5 两类代理,或者单独设置其中一类代理。如果你同时设置了 Http 隧道 和 Socks5 两类代理,此时,媒体和信令采用 Socks5 代理, Http 请求采用 Http 隧道代理;如果只设置 Http 隧道 或 Socks5 一类代理,媒体、信令和 Http 请求均采用已设置的代理。 * 调用此接口设置本地代理后,若想清空当前已有的代理设置,可再次调用此接口,选择不设置任何代理即可清空。 * @notes + 该方法需要在进房前调用。 * + 调用该方法设置本地代理后,SDK 会触发 [onLocalProxyStateChanged](85533#rtcvideocallback-onlocalproxystatechanged) ,返回代理连接的状态。 * @group Security and Encryption * @order 10 */ setLocalProxy(configurations: LocalProxyConfiguration[]): number; /** {en} * @brief Turn on/off the earphone monitor function * @param mode Whether to turn on the earphone monitor function. * @returns + 0: Success. * + < 0 : Fail. * @notes You can use ear monitoring feature when the earpiece is directly connected to the device by 3.5mm interface, USB interface, or BlueTooth. You cannot use ear monitoring feature when the earpiece is connected to a monitor via the HDMI or USB-C interface, and then connected to the device, or connected to an OTG external sound card, and then connected to the device. * @group Advanced Features * @order 15 */ /** {zh} * @brief 开启/关闭耳返功能 * @param mode 是否开启耳返功能 * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @notes 耳返功能仅支持设备通过 3.5mm 接口、USB 接口、或蓝牙方式直连耳机时可以使用。对于通过 HDMI 或 USB-C 接口连接显示器,再连接,或通过连接 OTG 外接声卡再连接的耳机,不支持耳返功能。 * @group Advanced Features * @order 15 */ setEarMonitorMode(mode: EarMonitorMode): number; /** {en} * @brief Set the volume of the earphone monitor * @param volume The volume of the earphone monitor, the value range: [0,100], the unit:% * @returns + 0: Success. * + < 0 : Fail. * @notes Before setting the volume of the earphone monitor, you must first call [setEarMonitorMode](85532#rtcvideo-setearmonitormode) to turn on the earphone monitor function. * @group Advanced Features * @order 16 */ /** {zh} * @brief 设置耳返的音量 * @param volume 耳返的音量相对原始音量的比值,取值范围:[0,100],单位:% * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @notes 设置耳返音量前,你必须先调用 [setEarMonitorMode](85532#rtcvideo-setearmonitormode) 打开耳返功能。 * @group Advanced Features * @order 16 */ setEarMonitorVolume(volume: number): number; /** {en} * @brief Create an instance for audio effect player. * @returns an instance for audio effect player * @group Audio Effect Player * @order 0 */ /** {zh} * @brief 创建音效播放器实例。 * @returns 音效播放器。 * @group Audio Effect Player * @order 0 */ getAudioEffectPlayer(): veRTCAudioEffectPlayer; /** {en} * @brief Create a media player instance. * @param player_id Media player id. The range is `[0, 3]`. You can create up to 4 instances at the same time. If it exceeds the range, nullptr will be returned. * @returns Media player instance * @group Media Player * @order 0 */ /** {zh} * @brief 创建音乐播放器实例。 * @param player_id 音乐播放器实例 id。取值范围为 `[0, 3]`。最多同时存在4个实例,超出取值范围时返回 nullptr。 * @returns 音乐播放器实例 * @group Media Player * @order 0 */ getMediaPlayer(player_id: number): veRTCMediaPlayer; /** {en} * @brief Enable the audio process mode for external sound card. * @param enable * + true: enable * + false: disable (by default) * @returns + 0: Success. * + < 0 : Fail. * @notes + When you use external sound card for audio capture, enable this mode for better audio quality. * + When using the mode, you can only use earphones. If you need to use internal or external speaker, disable this mode. * @group Audio Management * @order 87 */ /** {zh} * @brief 启用匹配外置声卡的音频处理模式 * @param enable + true: 开启 * + false: 不开启(默认) * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @notes + 当采用外接声卡进行音频采集时,建议开启此模式,以获得更好的音质。 * + 开启此模式时,仅支持耳机播放。如果需要使用扬声器或者外置音箱播放,关闭此模式。 * @group Audio Management * @order 87 */ enableExternalSoundCard(enable: boolean): number; /** {en} * @brief Enable audio frames callback and set the format for the specified type of audio frames. * @param method Audio data callback method. * If `method` is set as `kRecord`, `kPlayback`, `kMixed`, `kRecordScreen`, set `format` to the accurate value listed in the audio parameters format. * If `method` is set as `kRemoteUser`, set `format` to default value. * @param format Audio parameters format. * @returns + 0: Success. * + < 0 : Fail. * @group Custom Stream Processing * @order 40 */ /** {zh} * @brief 设置并开启指定的音频数据帧回调。 * @param method 音频回调方法。方法对应的回调名称参见类型说明。每次调用本接口设置一种回调。 * + 当音频回调方法设置为 `kAudioFrameCallbackRecord`、`kAudioFrameCallbackPlayback`、`kAudioFrameCallbackMixed`、`kAudioFrameCallbackRecordScreen`时,你需要在参数 `format` 中指定准确的采样率和声道,暂不支持设置为自动。 * + 当音频回调方法设置为 `kAudioFrameCallbackRemoteUser`时,应将 `format` 的字段设置为默认值。 * @param format 音频参数格式 * @returns + 0: 调用成功。 * + < 0 : 调用失败 * @group Custom Stream Processing * @order 40 */ enableAudioFrameCallback(method: AudioFrameCallbackMethod, format: AudioFormat): number; /** {en} * @brief Disables audio data callback. * @param method Audio data callback method. * @returns + 0: Success. * + < 0 : Fail. * @notes Call this API after calling [enableAudioFrameCallback](85532#rtcvideo-enableaudioframecallback). * @group Custom Stream Processing * @order 41 */ /** {zh} * @brief 关闭音频回调 * @param method 音频回调方法 * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @notes 该方法需要在调用 [enableAudioFrameCallback](85532#rtcvideo-enableaudioframecallback) 之后调用。 * @group Custom Stream Processing * @order 41 */ disableAudioFrameCallback(method: AudioFrameCallbackMethod): number; /** {en} * @brief On the listener side, set all subscribed audio streams precisely timely aligned. * @param streamKey The remote audio stream used as the benchmark during time alignment. * You are recommended to use the audio stream from the lead singer. * You must call this API after receiving [onUserPublishStream](85533#rtcroomcallback-onuserpublishstream). * @param mode Whether to enable the alignment. Disabled by default. * @returns + 0: Success. * + < 0 : Fail. * @notes + You must use the function when all participants set [RoomProfileType](85535#roomprofiletype) to `kRoomProfileTypeChorus` when joining the room. * + All remote participants must call [startAudioMixing](85532#rtcvideo-startaudiomixing) to play background music and set `sync_progress_to_record_frame` of [AudioMixingConfig](85535#audiomixingconfig) to `true`. * + If the subscribed audio stream is delayed too much, it may not be precisely aligned. * + The chorus participants must not enable the alignment. If you wish to change the role from listener to participant, you should disable the alignment. * @group Push to CDN * @order 5 */ /** {zh} * @brief 在听众端,设置订阅的所有远端音频流精准对齐后播放。 * @param streamKey 作为对齐基准的远端音频流。 * 一般选择主唱的音频流。 * 你必须在收到 [onUserPublishStream](85533#rtcroomcallback-onuserpublishstream),确认此音频流已发布后,调用此 API。 * @param mode 是否对齐,默认不对齐。 * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @notes + 你必须在实时合唱场景下使用此功能。在加入房间时,所有人应设置 [RoomProfileType](85535#roomprofiletype) 为 `kRoomProfileTypeChorus`。 * + 订阅的所有远端流必须通过 [startAudioMixing](85532#rtcvideo-startaudiomixing) 开启了背景音乐混音,并将 [AudioMixingConfig](85535#audiomixingconfig) 中的 `sync_progress_to_record_frame` 设置为 `true`。 * + 如果订阅的某个音频流延迟过大,可能无法实现精准对齐。 * + 合唱的参与者不应调用此 API,因为调用此 API 会增加延迟。如果希望从听众变为合唱参与者,应关闭对齐功能。 * @group Push to CDN * @order 5 */ setAudioAlignmentProperty(streamKey: RemoteStreamKey, mode: AudioAlignmentMode): number; /** {en} * @brief Enables/disables the playback ducking function. This function is usually used in scenarios where short videos or music will be played simultaneously during RTC calls. * @param enable Whether to enable playback ducking: * + true: Yes * + false: No * @returns * + 0: Success. * + < 0 : Fail. * @notes With the function on, if remote voice is detected, the local media volume will be lowered to ensure the clarity of the remote voice. If remote voice disappears, the local media volume restores. * @group Audio Processing * @order 50 */ /** {zh} * @brief 打开/关闭音量闪避功能,适用于在 RTC 通话过程中会同时播放短视频或音乐的场景,如“一起看”、“在线 KTV”等。开启该功能后,当检测到远端人声时,本地的媒体播放音量会自动减弱,从而保证远端人声的清晰可辨;当远端人声消失时,本地媒体音量会恢复到闪避前的音量水平。 * @param enable 是否开启音量闪避: * + true: 是 * + false: 否 * @returns + 0: 调用成功。 * + < 0 : 调用失败。 * @group Audio Processing * @order 50 */ enablePlaybackDucking(enable: boolean): number; /** {en} * @brief Start the capture and playback test for local audio devices. * @param indication_interval During the test, you'll receive `onLocalAudioPropertiesReport` periodically. Set the period in ms with this parameter. Recommended value is 200 ms; the minimal value is 10 ms. * @returns result * + 0: success * + < 0: failure * @notes * + The audio capturing stops in 30s after calling this API and begins to play the recording audio. Before that, you can call [stopAudioDeviceRecordAndPlayTest](85532#rtcvideo-stopaudiodevicerecordandplaytest) to stop audio capturing and start playing the recording audio. * + Call [stopAudioDevicePlayTest](85532#rtcvideo-stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording. * + You must stop the test before starting another test for audio devices. * + You must stop the test before calling `enableAudioPropertiesReport`. * + This test performs locally and does not involve network connection testing. * @group Audio Management * @order 81 */ /** {zh} * @brief 开始音频采集设备和音频播放设备测试。 * @param indication_interval 测试中会收到 `onLocalAudioPropertiesReport` 回调,本参数指定了该周期回调的时间间隔,单位为毫秒。建议设置到大于 200 毫秒。最小不得少于 10 毫秒。 * @returns 方法调用结果 * + 0:方法调用成功 * + < 0:方法调用失败 * @notes * + 该方法在进房前后均可调用。且不可与其它音频设备测试功能同时应用。 * + 调用本接口 30 s 后,采集自动停止,并开始播放采集到的声音。录音播放完毕后,设备测试流程自动结束。你也可以在 30 s 内调用 [stopAudioDeviceRecordAndPlayTest](85532#rtcvideo-stopaudiodevicerecordandplaytest) 来停止采集并开始播放此前采集到的声音。 * + 调用 [stopAudioDevicePlayTest](85532#rtcvideo-stopaudiodeviceplaytest) 可以停止音频设备采集和播放测试。 * + 你不应在测试过程中,调用 `enableAudioPropertiesReport` 注册音量提示回调。 * + 该方法仅在本地进行音频设备测试,不涉及网络连接。 * @group Audio Management * @order 81 */ startAudioDeviceRecordTest(indication_interval: number): number; /** {en} * @brief Call this API to stop recording in the test and start to play the recording in 30 s after calling [startAudioDeviceRecordTest](85532#rtcvideo-startaudiodevicerecordtest). * @returns result * + 0: Success * + < 0: Failure * @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](85532#rtcvideo-stopaudiodeviceplaytest) to stop playing. * @group Audio Management * @order 83 */ /** {zh} * @brief 停止采集本地音频,并开始播放采集到的声音。录音播放完毕后,设备测试流程结束。 * @returns 方法调用结果 * + 0:方法调用成功 * + < 0:方法调用失败 * @notes + 调用 [`startAudioDeviceRecordTest`](85532#rtcvideo-startaudiodevicerecordtest) 30 s 内调用本接口来停止采集并开始播放此前采集到的声音。 * + 调用本接口开始播放录音后,可以在播放过程中调用 [`stopAudioDevicePlayTest`](85532#rtcvideo-stopaudiodeviceplaytest) 停止播放。 * @group Audio Management * @order 83 */ stopAudioDeviceRecordAndPlayTest(): number; /** {en} * @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](85532#rtcvideo-startaudiodevicerecordtest). * Before the test ends by itself, you can call this API to stop the recording or playing. * @returns + 0: Success * + < 0: failure * @group Audio Management * @order 85 */ /** {zh} * @brief 停止由调用 [startAudioDeviceRecordTest](85532#rtcvideo-startaudiodevicerecordtest) 开始的音频播放设备测试。 * @returns 方法调用结果 * + 0:方法调用成功 * + < 0:方法调用失败 * @notes 在音频播放设备测试自动结束前,可调用本接口停止音频采集与播放测试。 * @group Audio Management * @order 85 */ stopAudioDevicePlayTest(): number; /** {zh} * @hidden * @brief 公共流视频帧发送 SEI 数据。 * @param stream_index 指定携带 SEI 数据的媒体流类型。 * @param channel_id SEI 消息传输通道,取值范围 [0 - 255]。通过此参数,你可以为不同接受方设置不同的 ChannelID,这样不同接收方可以根据回调中的 ChannelID 选择应关注的 SEI 信息。 * @param message SEI 消息。 * @param repeat_count 消息发送重复次数。取值范围是 [0, max{29, %{视频帧率}-1}]。推荐范围 [2,4]。 * 调用此接口后,SEI 数据会添加到从当前视频帧开始的连续 `repeat_count+1` 个视频帧中。 * @param mode SEI 发送模式。 * @return + < 0:说明调用失败 * + = 0:说明当前发送队列已满,无法发送 * + > 0: 说明调用成功,该数值为已经发送 SEI 的数量 * @notes + 每秒发送的 SEI 消息数量建议不超过当前的视频帧率 * + 视频通话场景中,使用自定义采集并通过 [`pushExternalVideoFrame`](85532#rtcvideo-pushexternalvideoframe) 推送至 SDK 的视频帧,若本身未携带 SEI 数据,也可通过本接口发送 SEI 数据;若原视频帧中已添加了 SEI 数据,则调用此方法不生效。 * + 视频帧仅携带前后 2s 内收到的 SEI 数据 * + 消息发送成功后,远端会收到 [`onPublicStreamSEIMessageReceivedWithChannel`](85532#rtcvideocallback-onpublicstreamseimessagereceivedwithchannel) 回调。 * + 调用失败时,本地及远端都不会收到回调。 * @group Public Stream * @order 13 */ sendPublicStreamSEIMessage(stream_index: StreamIndex, channel_id: number, message: Uint8Array, repeat_count: number, mode: SEICountPerFrame): number; /** {zh} * @brief 设置视频暗光增强模式。对于光线不足、照明不均匀或背光等场景下推荐开启,可有效改善画面质量。 * @param mode 默认不开启。 * @return + 0: API 调用成功。会立即生效,但需要等待下载和检测完成后才能看到增强后的效果。 * + < 0: API 调用失败。 * @notes + 开启后会影响设备性能,应根据实际需求和设备性能决定是否开启。 * + 对 RTC SDK 内部采集的视频和自定义采集的视频都生效。 * @group Video Processing * @order 60 */ setLowLightAdjusted(mode: VideoEnhancementMode): number; /** * @private: Solve the problem of failure to render due to user calling setupRemoteVideo before entering the room. */ private setPreRemoteVideo; /** * @private */ private removePreRemoteVideo; /** * @private */ private removeAllPreRemoteVideo; /** * @private */ private destoryRenderer; /** * @hidden */ notifyUserJoin(roomId: string, userId: string): void; /** * @private */ private tryPreRemoteVideoRender; /** * @private */ private onLocalVideoFrame; /** * @private */ private onLocalScreenFrame; /** * @private */ private onRemoteVideoFrame; /** * @private */ private onPublicStreamVideoFrame; /** * @private */ private onMixingVideoFrame; /** * @private */ private onRemoteScreenFrame; /** * @private */ private cbEngine; /** * @private */ private fire; /** * @private */ private processRTCVIDEOCALLBACK; /** * @private */ findUser(userId: string, roomId: string): UserRenderInfo | null | undefined; } /** The RTCVideo interface. */ declare interface RTCVideo { on(evt: "onLocalScreenFrame", cb: RTCVIDEOCALLBACK["onLocalScreenFrame"]): this; on(evt: "onLocalVideoFrame", cb: RTCVIDEOCALLBACK["onLocalVideoFrame"]): this; on(evt: "onRemoteScreenFrame", cb: RTCVIDEOCALLBACK["onRemoteScreenFrame"]): this; on(evt: "onRemoteVideoFrame", cb: RTCVIDEOCALLBACK["onRemoteVideoFrame"]): this; on(evt: "onPublicStreamVideoFrame", cb: RTCVIDEOCALLBACK["onPublicStreamVideoFrame"]): this; on(evt: "onPlayPublicStreamResult", cd: RTCVIDEOCALLBACK["onPlayPublicStreamResult"]): this; on(evt: "onPublicStreamSEIMessageReceived", cd: RTCVIDEOCALLBACK["onPublicStreamSEIMessageReceived"]): this; on(evt: "onFirstPublicStreamVideoFrameDecoded", cd: RTCVIDEOCALLBACK["onFirstPublicStreamVideoFrameDecoded"]): this; on(evt: "onPushPublicStreamResult", cd: RTCVIDEOCALLBACK["onPushPublicStreamResult"]): this; on(evt: "onFirstPublicStreamAudioFrame", cd: RTCVIDEOCALLBACK["onFirstPublicStreamAudioFrame"]): this; on(evt: "onWarning", cb: RTCVIDEOCALLBACK["onWarning"]): this; on(evt: "onError", cb: RTCVIDEOCALLBACK["onError"]): this; on(evt: "onAudioMixingFinished", cb: RTCVIDEOCALLBACK["onAudioMixingFinished"]): this; on(evt: "onAudioMixingStateChanged", cb: RTCVIDEOCALLBACK["onAudioMixingStateChanged"]): this; on(evt: "onLogReport", cb: RTCVIDEOCALLBACK["onLogReport"]): this; on(evt: "onConnectionStateChanged", cb: RTCVIDEOCALLBACK["onConnectionStateChanged"]): this; on(evt: "onNetworkTypeChanged", cb: RTCVIDEOCALLBACK["onNetworkTypeChanged"]): this; on(evt: "onPerformanceAlarms", cb: RTCVIDEOCALLBACK["onPerformanceAlarms"]): this; on(evt: "onSysStats", cb: RTCVIDEOCALLBACK["onSysStats"]): this; on(evt: "onUserStartAudioCapture", cb: RTCVIDEOCALLBACK["onUserStartAudioCapture"]): this; on(evt: "onFirstLocalAudioFrame", cb: RTCVIDEOCALLBACK["onFirstLocalAudioFrame"]): this; on(evt: "onFirstRemoteAudioFrame", cb: RTCVIDEOCALLBACK["onFirstRemoteAudioFrame"]): this; on(evt: "onSimulcastSubscribeFallback", cb: RTCVIDEOCALLBACK["onSimulcastSubscribeFallback"]): this; on(evt: "onFirstLocalVideoFrameCaptured", cb: RTCVIDEOCALLBACK["onFirstLocalVideoFrameCaptured"]): this; on(evt: "onLocalVideoSizeChanged", cb: RTCVIDEOCALLBACK["onLocalVideoSizeChanged"]): this; on(evt: "onFirstRemoteVideoFrameRendered", cb: RTCVIDEOCALLBACK["onFirstRemoteVideoFrameRendered"]): this; on(evt: "onFirstRemoteVideoFrameDecoded", cb: RTCVIDEOCALLBACK["onFirstRemoteVideoFrameDecoded"]): this; on(evt: "onRemoteVideoSizeChanged", cb: RTCVIDEOCALLBACK["onRemoteVideoSizeChanged"]): this; on(evt: "onUserStartVideoCapture", cb: RTCVIDEOCALLBACK["onUserStartVideoCapture"]): this; on(evt: "onUserStopVideoCapture", cb: RTCVIDEOCALLBACK["onUserStopVideoCapture"]): this; on(evt: "onLocalAudioStateChanged", cb: RTCVIDEOCALLBACK["onLocalAudioStateChanged"]): this; on(evt: "onRemoteAudioStateChanged", cb: RTCVIDEOCALLBACK["onRemoteAudioStateChanged"]): this; on(evt: "onLocalVideoStateChanged", cb: RTCVIDEOCALLBACK["onLocalVideoStateChanged"]): this; on(evt: "onRemoteVideoStateChanged", cb: RTCVIDEOCALLBACK["onRemoteVideoStateChanged"]): this; on(evt: "onAudioFrameSendStateChanged", cb: RTCVIDEOCALLBACK["onAudioFrameSendStateChanged"]): this; on(evt: "onVideoFrameSendStateChanged", cb: RTCVIDEOCALLBACK["onVideoFrameSendStateChanged"]): this; on(evt: "onScreenVideoFrameSendStateChanged", cb: RTCVIDEOCALLBACK["onScreenVideoFrameSendStateChanged"]): this; on(evt: "onAudioFramePlayStateChanged", cb: RTCVIDEOCALLBACK["onAudioFramePlayStateChanged"]): this; on(evt: "onVideoFramePlayStateChanged", cb: RTCVIDEOCALLBACK["onVideoFramePlayStateChanged"]): this; on(evt: "onScreenVideoFramePlayStateChanged", cb: RTCVIDEOCALLBACK["onScreenVideoFramePlayStateChanged"]): this; on(evt: "onUserMessageSendResult", cb: RTCVIDEOCALLBACK["onUserMessageSendResult"]): this; on(evt: "onUserMessageSendResult", cb: RTCVIDEOCALLBACK["onUserMessageSendResult"]): this; on(evt: "onLoginResult", cb: RTCVIDEOCALLBACK["onLoginResult"]): this; on(evt: "onLogout", cb: RTCVIDEOCALLBACK["onLogout"]): this; on(evt: "onServerParamsSetResult", cb: RTCVIDEOCALLBACK["onServerParamsSetResult"]): this; on(evt: "onGetPeerOnlineStatus", cb: RTCVIDEOCALLBACK["onGetPeerOnlineStatus"]): this; on(evt: "onUserMessageReceivedOutsideRoom", cb: RTCVIDEOCALLBACK["onUserMessageReceivedOutsideRoom"]): this; on(evt: "onUserBinaryMessageReceivedOutsideRoom", cb: RTCVIDEOCALLBACK["onUserBinaryMessageReceivedOutsideRoom"]): this; on(evt: "onUserMessageSendResultOutsideRoom", cb: RTCVIDEOCALLBACK["onUserMessageSendResultOutsideRoom"]): this; on(evt: "onServerMessageSendResult", cb: RTCVIDEOCALLBACK["onServerMessageSendResult"]): this; on(evt: "onRecordAudioFrame", cb: RTCVIDEOCALLBACK["onRecordAudioFrame"]): this; on(evt: "onPlaybackAudioFrame", cb: RTCVIDEOCALLBACK["onPlaybackAudioFrame"]): this; on(evt: "onMixedAudioFrame", cb: RTCVIDEOCALLBACK["onMixedAudioFrame"]): this; on(evt: "onASRSuccess", cb: RTCVIDEOCALLBACK["onASRSuccess"]): this; on(evt: "onMessage", cb: RTCVIDEOCALLBACK["onMessage"]): this; on(evt: "onASRError", cb: RTCVIDEOCALLBACK["onASRError"]): this; on(evt: "onNetworkDetectionResult", cb: RTCVIDEOCALLBACK["onNetworkDetectionResult"]): this; on(evt: "onNetworkDetectionStopped", cb: RTCVIDEOCALLBACK["onNetworkDetectionStopped"]): this; on(evt: "onLocalAudioPropertiesReport", cb: RTCVIDEOCALLBACK["onLocalAudioPropertiesReport"]): this; on(evt: "onRemoteAudioPropertiesReport", cb: RTCVIDEOCALLBACK["onRemoteAudioPropertiesReport"]): this; on(evt: "onEchoTestResult", cb: RTCVIDEOCALLBACK["onEchoTestResult"]): this; on(evt: "onVideoDeviceStateChanged", cb: RTCVIDEOCALLBACK["onVideoDeviceStateChanged"]): this; on(evt: "onAudioDeviceStateChanged", cb: RTCVIDEOCALLBACK["onAudioDeviceStateChanged"]): this; on(evt: "onActiveSpeaker", cb: RTCVIDEOCALLBACK["onActiveSpeaker"]): this; on(evt: "onAudioMixingPlayingProgress", cb: RTCVIDEOCALLBACK["onAudioMixingPlayingProgress"]): this; on(evt: "onStreamMixingEvent", cb: RTCVIDEOCALLBACK["onStreamMixingEvent"]): this; on(evt: "onStreamPushEvent", cb: RTCVIDEOCALLBACK["onStreamPushEvent"]): this; on(evt: "onRecordingStateUpdate", cb: RTCVIDEOCALLBACK["onRecordingStateUpdate"]): this; on(evt: "onRecordingProgressUpdate", cb: RTCVIDEOCALLBACK["onRecordingProgressUpdate"]): this; on(evt: "onAudioPlaybackDeviceTestVolume", cb: RTCVIDEOCALLBACK["onAudioPlaybackDeviceTestVolume"]): this; on(evt: "onStreamSubscribed", cb: RTCVIDEOCALLBACK["onStreamSubscribed"]): this; on(evt: "onSEIMessageReceived", cb: RTCVIDEOCALLBACK["onSEIMessageReceived"]): this; on(evt: "onRemoteVideoSuperResolutionModeChanged", cb: RTCVIDEOCALLBACK["onRemoteVideoSuperResolutionModeChanged"]): this; on(evt: "onTakeLocalSnapshotResult", cb: RTCVIDEOCALLBACK["onTakeLocalSnapshotResult"]): this; on(evt: "onTakeRemoteSnapshotResult", cb: RTCVIDEOCALLBACK["onTakeRemoteSnapshotResult"]): this; on(evt: "onCreateRoomStateChanged", cb: RTCVIDEOCALLBACK["onCreateRoomStateChanged"]): this; on(evt: "onHttpProxyState", cb: RTCVIDEOCALLBACK["onHttpProxyState"]): this; on(evt: "onHttpsProxyState", cb: RTCVIDEOCALLBACK["onHttpsProxyState"]): this; on(evt: "onSocks5ProxyState", cb: RTCVIDEOCALLBACK["onSocks5ProxyState"]): this; on(evt: "onStreamSyncInfoReceived", cb: RTCVIDEOCALLBACK["onStreamSyncInfoReceived"]): this; on(evt: "onScreenAudioFrameSendStateChanged", cb: RTCVIDEOCALLBACK["onScreenAudioFrameSendStateChanged"]): this; on(evt: "onScreenAudioFramePlayStateChanged", cb: RTCVIDEOCALLBACK["onScreenAudioFramePlayStateChanged"]): this; on(evt: "onCloudProxyConnected", cb: RTCVIDEOCALLBACK["onCloudProxyConnected"]): this; on(evt: "onNetworkTimeSynchronized", cb: RTCVIDEOCALLBACK["onNetworkTimeSynchronized"]): this; on(evt: "onLicenseWillExpire", cb: RTCVIDEOCALLBACK["onLicenseWillExpire"]): this; on(evt: "onMixingVideoFrame", cb: RTCVIDEOCALLBACK["onMixingVideoFrame"]): this; on(evt: "onMixingAudioFrame", cb: RTCVIDEOCALLBACK["onMixingAudioFrame"]): this; on(evt: "onMixingDataFrame", cb: RTCVIDEOCALLBACK["onMixingDataFrame"]): this; on(evt: "onAudioDeviceVolumeChanged", cb: RTCVIDEOCALLBACK["onAudioDeviceVolumeChanged"]): this; on(evt: "onCurrentScoringInfo", cb: RTCVIDEOCALLBACK["onCurrentScoringInfo"]): this; on(evt: "onAudioRecordingStateUpdate", cb: RTCVIDEOCALLBACK["onAudioRecordingStateUpdate"]): this; on(evt: "onExtensionAccessError", cb: RTCVIDEOCALLBACK["onExtensionAccessError"]): this; on(evt: "onPublicStreamDataMessageReceived", cb: RTCVIDEOCALLBACK["onPublicStreamDataMessageReceived"]): this; on(evt: "onHardwareEchoDetectionResult", cb: RTCVIDEOCALLBACK["onHardwareEchoDetectionResult"]): this; on(evt: "onLocalProxyStateChanged", cb: RTCVIDEOCALLBACK["onLocalProxyStateChanged"]): this; on(evt: "onMixingVideoFrame", cb: RTCVIDEOCALLBACK["onMixingVideoFrame"]): this; on(evt: "onMixingAudioFrame", cb: RTCVIDEOCALLBACK["onMixingAudioFrame"]): this; on(evt: "onMixingDataFrame", cb: RTCVIDEOCALLBACK["onMixingDataFrame"]): this; on(evt: "onClearCacheResult", cb: RTCVIDEOCALLBACK["onClearCacheResult"]): this; on(evt: "onRemoteUserAudioFrame", cb: RTCVIDEOCALLBACK["onRemoteUserAudioFrame"]): this; on(evt: "onRecordScreenAudioFrame", cb: RTCVIDEOCALLBACK["onRecordScreenAudioFrame"]): this; on(evt: "onAudioDeviceWarning", cb: RTCVIDEOCALLBACK["onAudioDeviceWarning"]): this; on(evt: "onVideoDeviceWarning", cb: RTCVIDEOCALLBACK["onVideoDeviceWarning"]): this; on(evt: "onSEIStreamUpdate", cb: RTCVIDEOCALLBACK["onSEIStreamUpdate"]): this; on(evt: "onPublicStreamSEIMessageReceivedWithChannel", cb: RTCVIDEOCALLBACK["onPublicStreamSEIMessageReceivedWithChannel"]): this; } export default RTCVideo;