// Copyright © 2022 BytePlusRTC All rights reserved. // SPDX-License-Identifier: MIT import { StreamIndex, type RenderMode, ChannelProfile, RTCRoom, AudioReportMode, AudioPropertiesMode, IAudioEffectPlayer as AudioEffectPlayer, AudioMixingType, IMediaPlayer, ScreenMediaType, ProblemFeedbackOption, SyncInfoStreamType, ReturnStatus, RTCScreenVideoEncoderPreference, LocalLogLevel, ByteRTCStreamMixingType, RTCVideoEncoderPreference, RemoteUserPriority } from './codegen/pack/index'; import { RTCVideo } from './core/rtc-video'; /** {en} * @detail api * @brief An engine class encapsulated by the {@link RTCVideo RTCVideo} class of the Android/iOS SDK. */ export type IEngine = Omit & { /** {en} * @brief Sets the view to be used for local video rendering and the rendering mode. * @param streamIndex Video stream type. * @param videoCanvas View information and rendering mode. * @return * - 0: Success * - -1: videoCanvas is empty * @note * - You should bind your stream to a view before joining the room. This setting will remain in effect after you leave the room. * - If you need to unbind the local video stream from the current view, you can call this API and set the videoCanvas to `null`. */ setLocalVideoCanvas: (streamIndex: StreamIndex, videoCanvas: IVideoCanvas) => number | undefined; /** {en} * @brief Sets the view to be used for remote video rendering and the rendering mode.
* To unbind the canvas, set `videoCanvas` to Null. * @param remoteInfo See {@link IRemoteInfo IRemoteInfo}. * @param videoCanvas View information and rendering mode. You can set the rotation angle of the remote video rendering using `renderRotation`. * @return * - 0: Success. * - < 0 : Fail. See {@link ReturnStatus ReturnStatus} for more details * @noteWhen the local user leaves the room, the setting will be invalid. The remote user leaving the room does not affect the setting. */ setRemoteVideoCanvas: (remoteInfo: IRemoteInfo, videoCanvas: IVideoCanvas) => ReturnStatus; /** {en} * @brief Create a room instance.
* This API only returns a room instance. You still need to call {@link joinRoom joinRoom} to actually create/join the room. * @param roomId The string matches the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`. * @return {@link RTCRoom RTCRoom} instance. * @note * - If the room that you wish to join already exists, you still need to call this API first to create the RTCRoom instance, and then call {@link joinRoom joinRoom}. * - Do not create multiple rooms with the same roomId, otherwise the newly created room instance will replace the old one. * - To forward streams to the other rooms, call {@link startForwardStreamToRooms startForwardStreamToRooms} instead of enabling Multi-room mode. */ createRTCRoom: (roomId: string) => IRoom; /** {en} * @brief Create an instance for audio effect player. * @return AudioEffectPlayer. */ getAudioEffectPlayer: () => I_AudioEffectPlayer; /** {en} * @brief Create a media player instance. * @return Media player instance. */ getMediaPlayer: (playerId: number) => I_MediaPlayer; /** {en} * @brief Enable cellular network assisted communication to improve call quality. * @param config See {@link IEnhanceMentConfig IEnhanceMentConfig}。 */ setCellularEnhancement: (config: IEnhanceMentConfig) => number; /** {en} * @brief Enable audio information prompts. After that, you will receive {@link onLocalAudioPropertiesReport onLocalAudioPropertiesReport}{@link onRemoteAudioPropertiesReport ,onRemoteAudioPropertiesReport} and {@link onActiveSpeaker onActiveSpeaker}。 * @param config See {@link IAudioPropertiesConfig IAudioPropertiesConfig} * @return * - 0: Success. * - <0: Fail. See {@link ReturnStatus ReturnStatus} for more details */ enableAudioPropertiesReport: (config: IAudioPropertiesConfig) => number; /** {en} * @brief Adjusts the audio playback volume from the specified remote user. * @param remoteStreamInfo Remote user's info, See {@link IRemoteStreamInfo IRemoteStreamInfo} * @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 to `100`.
* - 0: mute * - 100: original volume. Default value * - 400: Maximum can be 4 times the original volume (with overflow protection) * @return API call result:
* - 0: Success. * - <0: Failure. See {@link ReturnStatus ReturnStatus} for specific reasons. * @noteSuppose a remote user A is always within the range of the target user whose playback volume will be adjusted,
* - If you use both this method and {@link setRemoteRoomAudioPlaybackVolume setRemoteRoomAudioPlaybackVolume}, the volume that the local user hears from user A is the volume set by the method called later. * - If you use both this method and {@link setPlaybackVolume setPlaybackVolume}, the volume that the local user hears from user A is the overlay of both settings. */ setRemoteAudioPlaybackVolume: (remoteStreamInfo: IRemoteStreamInfo, volume: number) => number; /** {en} * @brief Set the encoding configuration for shared-screen streams, including the resolution, frame rate, bitrate, and fallback strategies under challenging network conditions. * @param config The encoding configuration for shared-screen streams. See {@link IScreenSolution IScreenSolution}. * @return * - 0: Success. * - !0: Failure. * @noteWe recommend that you set the encoding configuration before video capture. Otherwise, the video will be captured based on the default configuration(1080p@15fps). */ setScreenVideoEncoderConfig: (config: IScreenSolution) => number; /** {en} * @brief Use the RTC SDK internal acquisition module to start capturing screen audio and/or video streams. * @param type Media type. See {@link ScreenMediaType ScreenMediaType}。 * @param bundleId If it is an iOS device, you must also pass in your APP's Bundle ID. * @return * - 0: Success. * - <0: Failure. See {@link ReturnStatus ReturnStatus} for specific reasons. * @note * - The call of this API takes effects only when you are using RTC SDK to record screen. You will get a warning by {@link onVideoDeviceWarning onVideoDeviceWarning} or {@link onAudioDeviceWarning onAudioDeviceWarning} after calling this API when the source is set to an external recorder. * - After capturing, you need to call {@link publishScreen publishScreen} to push to the remote end. * - You will receive {@link onVideoDeviceStateChanged onVideoDeviceStateChanged} and {@link onAudioDeviceStateChanged onAudioDeviceStateChanged} when the capturing is started. * - To stop capturing, call {@link stopScreenCapture stopScreenCapture}. */ startScreenCapture: (type: ScreenMediaType, bundleId?: string) => Promise; /** {en} * @brief Setting runtime parameters * @example { 'rtc.audio_scene_id': 'ktv' } * @return * - 0: Success. * - <0: Fail. See {@link ReturnStatus ReturnStatus} for more details. * @noteCall this API before {@link joinRoom joinRoom} and {@link startAudioCapture startAudioCapture}. */ setRuntimeParameters: (params: Record) => number; /** {en} * @brief Report the user feedback to RTC. * @param options List of preset problems. See {@link ProblemFeedbackOption ProblemFeedbackOption} * @param info Specific description of other problems other than the preset problem, room's information. {@link IFeedbackProblemInfo IFeedbackProblemInfo} * @return * - 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 * @noteIf 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. */ feedback(options: ProblemFeedbackOption[], info: IFeedbackProblemInfo): number; /** {en} * @brief After subscribing to the remote video stream, request the keyframe * @param remoteInfo Remote stream information to the remote. See {@link IRemoteInfo IRemoteInfo}. * @return * - 0: Success. * - <0: Fail. See {@link ReturnStatus ReturnStatus} for more details * @note * - This method is only suitable for manual subscription mode and is used after successful subscription to the remote flow. * - This method is suitable for calling {@link setVideoDecoderConfig setVideoDecoderConfig} to turn on the custom decoding function, and the custom decoding fails */ requestRemoteVideoKeyFrame(remoteInfo: IRemoteInfo): 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. After the interface is successfully called, the remote user will receive a {@link onStreamSyncInfoReceived onStreamSyncInfoReceived} callback. * @param data Message content. * @param info Configuration related to audio stream synchronization information. See {@link IStreamSyncInfoConfig IStreamSyncInfoConfig}. * @return * - >= 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 {@link ErrorCode ErrorCode}. * @note * - Regarding the frequency, we recommend no more than 50 calls per second. * - When using `CHANNEL_PROFILE_INTERACTIVE_PODCAST` as room profile, the data will be delivered. For other coom profiles, the data may be lost when the local user is muted. */ sendStreamSyncInfo(data: ArrayBuffer, info: IStreamSyncInfoConfig): number; /** {en} * @detail api * @region Video Management * @author zhaomingliang * @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, and fallback strategy in poor network conditions.
* You can only set configuration for one stream with this API. If you want to set configuration for multiple streams, Call [setVideoEncoderConfig](#RTCVideo-setvideoencoderconfig-2). * @param maxSolution The maximum video encoding parameter. See {@link VideoEncoderConfig VideoEncoderConfig}. * @return API call result:
* - 0: Success * - ! 0: Failure * @note * - You can use {@link enableSimulcastMode enableSimulcastMode} simultaneously to publish streams with different resolutions. Specifically, if you want to publish multiple streams with different resolutions, you need to call this method and enable the simulcast mode with {@link enableSimulcastMode enableSimulcastMode} before publishing your streams. The SDK will intelligently adjust the number of streams to be published (up to 4) and their parameters based on the settings of the subscribing end. The resolution set by calling this method will be the maximum resolution among the streams. For specific rules, please refer to [Simulcasting](https://docs.byteplus.com/en/byteplus-rtc/docs/70139). * - Without calling this API, SDK will only publish one stream for you with a resolution of 640px × 360px and a frame rate of 15fps. * - In custom capturing scenario, you must call this API to set encoding configurations to ensure the integrity of the picture received by the remote users. * - This API is applicable to the video stream captured by the camera, see {@link setScreenVideoEncoderConfig setScreenVideoEncoderConfig} for setting parameters for screen sharing video stream. */ setVideoEncoderConfig(channelSolutions: IVideoEncoderConfig[]): number; /** {en} * @brief Start to observe vod player, capture frames from vod player and set stream for external screen stream. * @param player The player instance call by `initPlayer` from `react-native-vod-player` SDK. * @return * - 0: Success. * - <0: Failed. */ startVodPlayerCapture(player: any): number; /** {en} * @brief Stop all vod player observer in rtc. * @noteOnce you invoke this api, you should invoke `startVodPlayerCapture` to observe vod player. */ stopVodPlayerCapture(player: any): number; /** {en} * @detail api * @region Push to CDN * @brief Create a new task of pushing a single media stream to CDN. * @param taskId 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. See IPushSingleStreamParam。. * @return * - 0: Success. * - < 0 : Fail. See {@link ReturnStatus ReturnStatus} for more details * @note * - Before calling this API,you need to enable Push to CDN on the [console](https://console.byteplus.com/rtc/workplaceRTC). * - Call {@link stopPushStreamToCDN stopPushStreamToCDN} to stop the task. * - Since this API does not perform encoding and decoding, the video stream pushed to RTMP will change according to the resolution, encoding method, and turning off the camera of the end of pushing streams. */ startPushSingleStreamToCDN(taskId: string, params: IPushSingleStreamParam): number; /** {en} * @detail api * @region audio & video fallback * @author panjian.fishing * @brief Set user priority. * @param roomid Room ID * @param uid
* The ID of the remote user. * @param priority
* Priority for remote users. See enumeration type RemoteUserPriority{@link #RemoteUserPriority}. * @return * - 0: Success. * - < 0: Failed. * @note * - This method is used with setSubscribeFallbackOption{@link #RTCVideo#setSubscribeFallbackOption}. * - 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. * - This method can be used before and after entering the room, and the priority of the remote user can be modified. * */ setRemoteUserPriority(roomId: string, uid: string, priority: RemoteUserPriority): number; setAudioScene(scene: AudioSceneType): Promise; }; /** {en} * @detail api * @brief A room class based on the {@link RTCRoom RTCRoom} class encapsulation of the Android/iOS SDK. */ export type IRoom = Omit & { /** {en} * @brief Join the room. * After creating a room by calling {@link createRTCRoom createRTCRoom}, call this API to join the room and make audio & video calls with other users in the room. * @param params params for joining the room. * @return * - 0: Success. * - -1: RoomID/userI nfo.uid contains invalid parameters. * - -2: Already in the room. After the interface call is successful, as long as the return value of 0 is received and {@link leaveRoom leaveRoom} is not called successfully, this return value is triggered when the room entry interface is called again, regardless of whether the filled room ID and user ID are duplicated. * The reason for the failure will be communicated via the {@link onRoomStateChanged onRoomStateChanged} callback. * @note * - In the same room with the same App ID, the user ID of each user must be unique. If two users have the same user ID, the user who entered the room later will kick the user who entered the room out of the room, and the user who entered the room will receive the {@link onRoomStateChanged onRoomStateChanged} callback notification. For the error type. See kErrorCodeDuplicateLogin in {@link ERROR_CODE_DUPLICATE_LOGIN ERROR_CODE_DUPLICATE_LOGIN}. * - Local users will receive onRoomStateChanged{@link#onRoomStateChanged} callback notification after calling this method to join the room successfully. If the local user is also a visible user, the remote user will receive an {@link onUserJoined onUserJoined} callback notification when joining the room. * - By default, the user is visible in an RTC room. Joining fails when the number of users in an RTC room reaches the upper limit. To avoid this, call {@link setUserVisibility setUserVisibility} to change the visibility of the audience users to `false` by considering the capacity for the invisible users is much larger than that for visible users. An RTC room can accommodate a maximum of 50 visible users, and 30 media streams can be published simultaneously. For more information, see [Capability of Users and Streams](https://docs.byteplus.com/en/byteplus-rtc/docs/257549). * - After the user successfully joins the room, the SDK may lose connection to the server in case of poor local network conditions. At this point, {@link onConnectionStateChanged onConnectionStateChanged} callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. After successful reconnection, {@link onRoomStateChanged onRoomStateChanged} callback notification will be received locally. */ joinRoom: (params: IJoinRoomProps) => number; /** {en} * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to. * @param userId ID of the remote video stream publisher you expect to configure subscription parameters for. * @param remoteVideoConfig The parameters you expect to configure for the remote video stream, see {@link IRemoteVideoConfig IRemoteVideoConfig}. * @return API call result: * - 0: Success. * - <0: Failure. See {@link ReturnStatus ReturnStatus} for specific reasons. * @note * - This API only works after the publisher calls {@link enableSimulcastMode enableSimulcastMode} to enable publishing multiple video streams, in which case the subscriber will receive the stream from the publisher that is closest to the set configuration; otherwise the subscriber will only receive one video stream with a resolution of 640px × 360px and a frame rate of 15fps. * - If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher. * - You should call this API in the room. If you want to call it before entering the room, you should set the `remoteVideoConfig` in the roomConfig` when calling {@link joinRoom joinRoom}. * - SDK will automatically select the stream to be published or subcribed based on the settings of both sides see for details. */ setRemoteVideoConfig: (userId: string, remoteVideoConfig: IRemoteVideoConfig) => number; /** {en} * @detail api * @brief Start to forawrd stream to specific rooms. */ startForwardStreamToRooms: (forwardStreamConfig: IForwardStreamConfig[]) => number; /** {en} * @detail api * @brief Update forawrd stream infos. */ updateForwardStreamToRooms: (forwardStreamConfig: IForwardStreamConfig[]) => number; }; /** {en} * @detail api * @brief An audio mixing player class encapsulated by the {@link AudioEffectPlayer AudioEffectPlayer} class of the Android/iOS SDK. */ export type I_AudioEffectPlayer = Omit & { /** {en} * @brief Starts to play the audio effect file.
* This API can be called multiple times with different IDs and filepaths for multiple effects at the same time. * @param effectId Audio effect ID. Used for identifying the audio effect, please ensure that the audio effect ID is unique. * If this API is called repeatedly with the same ID, the previous effect will stop and the next effect will start, and you'll receive {@link onAudioEffectPlayerStateChanged onAudioEffectPlayerStateChanged}. * @param path Audio effect file paths. * URL of online file, URI of local file, full path to local file, or path to local file starting with `/assets/` are supported. For URL of online file, only the https protocol is supported. * Recommended sample rate for audio effect files: 8KHz、16KHz、22.05KHz、44.1KHz、48KHz. * Local audio effect file formats supported by different platforms:
* * * * * *
mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYYYY
iOS/macOSYYYYYY
WindowsYYYYYYYY
* Online audio effect file formats supported by different platforms.
* * * * * *
mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYY
iOS/macOSYYYY
WindowsYYYYYYY
* @param config See {@link IAudioEffectPlayerConfig IAudioEffectPlayerConfig}. * @return * - 0: Success. * - <0: Fail. See {@link ReturnStatus ReturnStatus} for more details. * @note * - If the file has been loaded into memory via {@link preload preload}, make sure that the ID here is the same as the ID set by {@link preload preload}. * - After starting to play an audio effect file, you can call the {@link stop stop} API to stop playing the audio effect file. */ start: (effectId: number, path: string, config: IAudioEffectPlayerConfig) => I_AudioEffectPlayer; }; /** {en} * @detail api * @brief A media player class based on the {@link IMediaPlayer IMediaPlayer} class encapsulation of the Android/iOS SDK */ export type I_MediaPlayer = Omit & { /** {en} * @brief Open the audio file. * You can only open one audio file with one player instance at the same time. For multiple audio files at the same time, create multiple player instances. * For audio file in PCM format, see {@link openWithCustomSource openWithCustomSource}. `openWithCustomSource` and this API are mutually exclusive. * @param filePath Audio file paths. * URL of online file, URI of local file, full path to local file, or path to local file starting with `/assets/` are supported. For URL of online file, only the https protocol is supported. * Recommended sample rate for audio effect files: 8KHz、16KHz、22.05KHz、44.1KHz、48KHz. * Local audio effect file formats supported by different platforms: * * * * * *
mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYYYY
iOS/macOSYYYYYY
WindowsYYYYYYYY
* Online audio effect file formats supported by different platforms. * * * * * *
mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYY
iOS/macOSYYYY
WindowsYYYYYYY
* @param config See {@link IMediaPlayerConfig IMediaPlayerConfig}. * @return * - 0: Success. * - < 0 : Fail. See {@link ReturnStatus ReturnStatus} for more details. */ open: (filePath: string, config: IMediaPlayerConfig) => number; }; /** {en} * @detail keytype * @brief Engine initialize params */ export interface ICreateRTCEngineOptions { /** {en} * @brief Required. A unique identifier for each App, randomly generated by the RTC console. Engine instances created with different AppIds cannot communicate with each other. */ appID: string; /** {en} * @brief Optional. Reserved parameters. Please contact technical support fellow if needed. */ parameters?: Record; } /** {en} * @detail keytype * @brief View information and rendering mode */ export interface IVideoCanvas { /** {en} * @brief Component View id. */ viewId: string; /** {en} * @brief Render Mode */ renderMode?: RenderMode; } /** {en} * @detail keytype * @brief Remote users' info. */ export interface IRemoteInfo { /** {en} * @brief user id. */ userId: string; /** {en} * @brief Stream type. */ streamIndex: StreamIndex; /** {en} * @brief Room ID. */ roomId: string; } /** {en} * @detail keytype * @brief Stream synchronization configuration. */ export interface IStreamSyncInfoConfig { /** {en} * @brief Stream type. */ streamIndex: StreamIndex; /** {en} * @brief Repeat count. */ repeatCount: number; /** {en} * @brief Stream type for media stream information synchronization. */ streamType: SyncInfoStreamType; } /** {en} * @detail keytype * @brief Room configuration for joining. */ export interface IJoinRoomProps { /** {en} * @brief Dynamic key. It is used for authentication and verification of users entering the room. * You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. See [Use Token to complete authentication](70121) for token validity and generation method. * Apps with different AppIDs are not interoperable. * Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail. */ token?: string; /** {en} * @brief User ID. The string matches the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`.
* You must set or manage the uid yourself and ensure that each uid within the same room is unique. */ userId: string; /** {en} * @brief Additional information of the user. The maximum length is 200 bytes. The remote user will receive the info in `onUserJoined`. */ extras?: Record; /** {en} * @brief Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow. */ roomConfigs?: { /** {en} * @brief Room profile. See {@link ChannelProfile ChannelProfile}. The default is `CHANNEL_PROFILE_COMMUNICATION`. The setting cannot be changed after joining the room. */ profile?: ChannelProfile; /** {en} * @brief Whether to publish video streams automatically. The default is automatic publishing. * Only one of the rooms the user joined can be set to auto-publish. If no settings are made in each room, the stream is automatically published in the first room joined by default. * If you call {@link setUserVisibility setUserVisibility} to set your own visibility to false, you will not publish video streams regardless of the value of `isAutoPublishVideo`. */ isAutoPublishVideo?: boolean; /** {en} * @brief Whether to publish audio streams automatically. The default is automatic publishing. * Only one of the rooms the user joined can be set to auto-publish. If no settings are made in each room, the stream is automatically published in the first room joined by default. * If you call {@link setUserVisibility setUserVisibility} to set your own visibility to false, you will not publish audio streams regardless of the value of `isAutoPublishAudio`. */ isAutoPublishAudio?: boolean; /** {en} * @brief Whether to automatically subscribe to the audio stream. The default is automatic subscription. * This setting affects both the main stream and the screen-sharing stream. */ isAutoSubscribeAudio?: boolean; /** {en} * @brief Whether to automatically subscribe to the main video stream. The default is automatic subscription. * This setting affects both the main stream and the screen-sharing stream. */ isAutoSubscribeVideo?: boolean; }; } /** {en} * @detail keytype * @brief Media type for cellular assisted Enhancement. */ export interface IEnhanceMentConfig { /** {en} * @brief Apply to signaling or not. Not by default. */ enhanceSignaling: boolean; /** {en} * @brief Apply to audio stream (Screen-sharing audio not included) or not. Not by default. */ enhanceAudio: boolean; /** {en} * @brief Apply to video (Screen-sharing video not included) or not. Not by default. */ enhanceVideo: boolean; /** {en} * @brief Apply to screen sharing audio or not. Not by default. */ enhanceScreenAudio: boolean; /** {en} * @brief Apply to screen sharing video or not. Not by default. */ enhanceScreenVideo: boolean; } /** {en} * @detail keytype * @brief Configuration related to audio attribute information prompt. */ export interface IAudioPropertiesConfig { /** {en} * @brief Prompt interval in ms * - `<= 0`: Turn off prompt * - `(0,100]`: Invalid interval value, and will be automatically reset to 100ms. * - `> 100`: the actual value of interval */ interval: number; /** {en} * @brief Whether to enable audio spectrum detection */ enableSpectrum: boolean; /** {en} * @brief Whether to enable Voice Activity Detection */ enableVad: boolean; /** {en} * @brief The volume callback modes. See {@link AudioReportMode AudioReportMode}. */ localMainReportMode: AudioReportMode; /** {en} * @brief The audio info included in {@link onLocalAudioPropertiesReport onLocalAudioPropertiesReport}. See {@link AudioPropertiesMode AudioPropertiesMode}. * Locally captured microphone audio info and locally captured screen audio info are included by default. */ audioReportMode: AudioPropertiesMode; /** {en} * @brief The smoothing coefficient for audio attribute information prompt. The range is `(0.0, 1.0]`. * The default value is `1.0`, which means the smoothing effect is off by default. Smaller the value, smoother the audio volume prompt. If you want to enable the smooth effect, the recommended value is `0.3`. */ smooth: number; /** {en} * @brief Sets whether to return the vocal pitch of the local user. */ enableVoicePitch: boolean; } export interface IVideoEncoderConfig { /** {en} * @brief Width of the video frame in px */ width?: number; /** {en} * @brief Height of the video frame in px */ height?: number; /** {en} * @brief Video frame rate in fps */ frameRate?: number; /** {en} * @brief Maximum bit rate in kbps. Optional for internal capturing while mandatory for custom capturing.
* If you set this value to -1, SDK will automatically calculate the applicable bit rate based on the input resolution and frame rate.
* No stream will be encoded and published if you set this value to 0. */ maxBitrate?: number; /** {en} * @brief Minimum video encoding bitrate in kbps. The encoding bitrate will not be lower than the `minBitrate`.
* It defaults to `0`.
* It ranges within [0, maxBitrate). When `maxBitrate` < `minBitrate`, the bitrate is self-adpapted.
* In the following circumstance, the assignment to this variable has no effect:
* - When `maxBitrate` = `0`, the video encoding is disabled. * - When `maxBitrate` < `0`, the bitrate is self-adapted. */ minBitrate?: number; /** {en} * @brief Encoding preference. */ encoderPreference?: RTCVideoEncoderPreference; } /** {en} * @detail keytype * @brief Remote stream info. */ export interface IRemoteStreamInfo { /** {en} * @brief The ID of Room that remote user staying. */ roomId: string; /** {en} * @brief The user ID of the remote user. */ userId: string; /** {en} * @brief The stream type of the remote user. */ streamIndex: StreamIndex; } /** {en} * @detail keytype * @brief The encoding configuration for shared-screen streams. */ export interface IScreenSolution { /** {en} * @brief The maximum width of the captured screen, measured in pixel. */ width: number; /** {en} * @brief The maximum height of the captured screen, measured in pixel. */ height: number; /** {en} * @brief The frame rate of the screen capture and encoding, measured in fps. */ frameRate: number; /** {en} * @brief The maximum bitrate(in kbps). Optional for internal capture while mandatory for custom capture. * If you set this value to -1, RTC will automatically recommend the bitrate based on the input resolution and frame rate. * If you set this value to 0, the streams will not be encoded and published. * On Version 3.44 or later, the default value for internal capture is -1. On versions earlier than 3.44, you must set the maximum bit rate because there is no default value. */ maxBitrate: number; /** {en} * @brief The minimum bitrate(in kbps).Optional for internal capture while mandatory for custom capture. * The minimum bitrate must be set lower than the maximum bitrate. Otherwise, the streams will not be encoded and published. */ minBitrate: number; /** {en} * @brief The preference for encoding screen-sharing streams. It defaults to the high-frame-rate mode. * See {@link RTCScreenVideoEncoderPreference RTCScreenVideoEncoderPreference}. */ encodePrefer: RTCScreenVideoEncoderPreference; } /** {en} * @detail keytype * @brief Audio effect player's configuration. */ export interface IAudioEffectPlayerConfig { /** {en} * @brief Mixing playback types. */ type: AudioMixingType; /** {en} * @brief Mix playback time * - Play_count <= 0: Infinite loop * - Play_count == 1: Play once (default) * - Play_count > 1: Play play_count times */ playCount: number; /** {en} * @brief The starting position in ms. 0 by default. */ startPos: number; /** {en} * @brief The increase or decrease value compared with the original pitch of the music file. The range is `[-12, 12]`. The default value is 0. The pitch distance between two adjacent values is half a step. A positive value indicates a rising pitch, and a negative value indicates a falling pitch. */ pitch: number; } /** {en} * @detail keytype * @brief Music effect player's configuration. */ export interface IMediaPlayerConfig { /** {en} * @brief Mixing playback types. */ type: AudioMixingType; /** {en} * @brief Music playback time * - Play_count <= 0: Infinite loop * - Play_count == 1: Play once (default) * - Play_count > 1: Play play_count times */ playCount: number; /** {en} * @brief The starting position in ms. 0 by default. */ startPos: number; /** {en} * @brief Play the audio automatically. If not, call {@link start start} to play the audio. */ autoPlay: boolean; /** {en} * @brief Set the interval of the periodic callback {@link onMediaPlayerPlayingProgress onMediaPlayerPlayingProgress} during music in ms. * - interval > 0: The callback is enabled. The actual interval is `10*(mod(10)+1)`. * - interval <= 0: The callback is disabled. */ progressInterval: number; /** {en} * @brief Attach the process information of local audio file mixing to the captured audio data. Enable the function to enhance the synchronicity of the remote audio mixing. * - The function is effective when mixing a single audio file. * - Use `true` for enabling the function and `false` for disable the function. The default is `false`. */ syncProgressToRecordFrame: boolean; } /** {en} * @detail keytype * @brief Information on remote video frame. */ export interface IRemoteVideoConfig { /** {en} * @brief Width of the video frame in px */ width: number; /** {en} * @brief Height of the video frame in px */ height: number; /** {en} * @brief Expected maximum frame rate of the subscribed stream in px. The default value is 0, which represents full-frame-rate, values greater than 0 are valid. * If the frame rate of the stream published is higher than the value set by the subscriber, the subscriber receives the video of the frame rate set by this API; if the frame rate of the stream published is lower than the value set by the subscriber, the subscriber receives the video of the same frame rate of the video published. * Only valid if the stream is coded with SVC technique. */ framerate: number; } /** {en} * @detail keytype * @brief Params for stream forwards. */ export interface IForwardStreamConfig { /** {en} * @brief Room ID */ roomId: string; /** {en} * @brief User ID */ token: string; } /** {en} * @detail keytype * @brief Params for stream push to cdn. */ export interface IPushSingleStreamParam { /** {en} * @brief The room ID of the media stream */ roomId: string; /** {en} * @brief The user ID of the media stream */ userId: string; /** {en} * @brief The URL for live transcoding. Only supports live transcoding via RTMP. The URL should match the regular expression `/^rtmps?:\\/\\//`.
* This parameter cannot be updated while pushing stream to the CDN. */ url: string; /** {en} * @brief Whether the media stream is a screen-sharing stream. */ isScreen?: boolean; } /** {en} * @detail keytype * @brief Local log parameters. */ export interface ILogConfigs { /** {en} * @brief (Optional) The logging level. See {@link LocalLogLevel LocalLogLevel}. The default is warning level. */ logLevel: LocalLogLevel; /** {en} * @brief (Required) Local log directory. */ logPath: string; /** {en} * @brief (Optional) The limits for total log file size in MB. The range is 1 to 100 MB, and the default value is 10 MB. * If `logFileSize` < 1, it will be set to 1 MB. If `logFileSize` > 100, it will be set to 100 MB. * The maximum size for a single log file is 2 MB. * If 1 ≤ `logFileSize` ≤ 2, one log file will be generated. If `logFileSize` > 2, the first `⌊logFileSize/2⌋` files will be filled with 2 MB each, the `⌊logFileSize/2⌋+1` fill will be filled with `logFileSize mod 2`.
* If the size exceeds the remaining space, the oldest file will be deleted. */ logFileSize: number; /** {en} * @brief (Optional) Local log file name prefix. It should follow the regular expression pattern of `[a-zA-Z0-9_@-.]{1,128}`. The final file name will be the prefix followed by "_" and the file creation time, and "_rtclog.log" at the end. For example, `logPrefix_2023-05-25_172324_rtclog.log`. */ logFilenamePrefix: string; } /** {en} * @detail keytype * @brief The encryption type. */ export declare enum EncryptTypes { /** {en} * @brief Not setting. */ NONE = 0, /** {en} * @brief AES128CBC. */ AES128CBC = 1, /** {en} * @brief AES256CBC. */ AES256CBC = 2, /** {en} * @brief AES128ECB. */ AES128ECB = 3, /** {en} * @brief AES256ECB. */ AES256ECB = 4 } /** {en} * @detail keytype * @brief Video call quality feedback preset infomation. */ export interface IFeedbackProblemInfo { /** {en} * @brief Text description. */ desc: string; /** {en} * @brief Room ID. */ roomId: string; /** {en} * @brief User ID. */ userId: string; } /** {en} * @detail keytype * @brief UMixed stream push to CDN. */ export interface IMixedStreamConfig { /** {en} * @brief Room ID for pushing stream. */ roomId: string; /** {en} * @brief User ID for pushing stream. */ userId: string; /** {en} * @brief CDN URL for pushing stream (rtmp/rtmps). */ pushURL: string; /** {en} * @brief Mixing type (normal/custom etc., enum/number/string, should align with SDK enum). */ expectedMixingType?: ByteRTCStreamMixingType; /** {en} * @brief Layout config for mixing, see below. */ layoutConfig?: IMixedStreamLayoutConfig; /** {en} * @brief Video transcoding config, see below. */ videoConfig?: IMixedStreamVideoConfig; /** {en} * @brief Audio transcoding config, see below. */ audioConfig?: IMixedStreamAudioConfig; /** {en} * @brief Client mix config, see below. */ clientMixConfig?: IMixedStreamClientMixConfig; /** {en} * @brief Spatial audio config, see below. */ spatialAudioConfig?: IMixedStreamSpatialAudioConfig; /** {en} * @brief Server control config, see below. */ serverControlConfig?: IMixedStreamServerControlConfig; } /** {en} * @brief Layout config for mixing. */ export interface IMixedStreamLayoutConfig { } /** {en} * @brief Video transcoding config. */ export interface IMixedStreamVideoConfig { } /** {en} * @brief Audio transcoding config. */ export interface IMixedStreamAudioConfig { } /** {en} * @brief Client mix config. */ export interface IMixedStreamClientMixConfig { } /** {en} * @brief Spatial audio config. */ export interface IMixedStreamSpatialAudioConfig { } /** {en} * @brief Server control config. */ export interface IMixedStreamServerControlConfig { } export declare enum AudioSceneType { AUDIO_SCENE_DEFAULT = 0, AUDIO_SCENE_CHATROOM = 1, AUDIO_SCENE_HIGH_QUALITY_CHATROOM = 2, AUDIO_SCENE_LOW_LATENCY = 3 }