Global

Members

(constant) TRTCVideoResolution :Number

Properties:
Name Type Description
TRTCVideoResolution_120_120 Number

Aspect ratio: 1:1; resolution: 120x120; recommended bitrate (VideoCall): 80 Kbps; recommended bitrate (LIVE): 120 Kbps.

TRTCVideoResolution_160_160 Number

Aspect ratio: 1:1; resolution: 160x160; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps.

TRTCVideoResolution_270_270 Number

Aspect ratio: 1:1; resolution: 270x270; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_480_480 Number

Aspect ratio: 1:1; resolution: 480x480; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 500 Kbps.

TRTCVideoResolution_160_120 Number

Aspect ratio: 4:3; resolution: 160x120; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps.

TRTCVideoResolution_240_180 Number

Aspect ratio: 4:3; resolution: 240x180; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps.

TRTCVideoResolution_280_210 Number

Aspect ratio: 4:3; resolution: 280x210; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_320_240 Number

Aspect ratio: 4:3; resolution: 320x240; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 375 Kbps.

TRTCVideoResolution_400_300 Number

Aspect ratio: 4:3; resolution: 400x300; recommended bitrate (VideoCall): 300 Kbps; recommended bitrate (LIVE): 450 Kbps.

TRTCVideoResolution_480_360 Number

Aspect ratio: 4:3; resolution: 480x360; recommended bitrate (VideoCall): 400 Kbps; recommended bitrate (LIVE): 600 Kbps.

TRTCVideoResolution_640_480 Number

Aspect ratio: 4:3; resolution: 640x480; recommended bitrate (VideoCall): 600 Kbps; recommended bitrate (LIVE): 900 Kbps.

TRTCVideoResolution_960_720 Number

Aspect ratio: 4:3; resolution: 960x720; recommended bitrate (VideoCall): 1000 Kbps; recommended bitrate (LIVE): 1500 Kbps.

TRTCVideoResolution_160_90 Number

Aspect ratio: 16:9; resolution: 160x90; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps.

TRTCVideoResolution_256_144 Number

Aspect ratio: 16:9; resolution: 256x144; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_320_180 Number

Aspect ratio: 16:9; resolution: 320x180; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 400 Kbps.

TRTCVideoResolution_480_270 Number

Aspect ratio: 16:9; resolution: 480x270; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 550 Kbps.

TRTCVideoResolution_640_360 Number

Aspect ratio: 16:9; resolution: 640x360; recommended bitrate (VideoCall): 500 Kbps; recommended bitrate (LIVE): 900 Kbps.

TRTCVideoResolution_960_540 Number

Aspect ratio: 16:9; resolution: 960x540; recommended bitrate (VideoCall): 850 Kbps; recommended bitrate (LIVE): 1300 Kbps.

TRTCVideoResolution_1280_720 Number

Aspect ratio: 16:9; resolution: 1280x720; recommended bitrate (VideoCall): 1200 Kbps; recommended bitrate (LIVE): 1800 Kbps. If used for screen share, recommended bitrate 1000Kbps for LD(Low Definition), 1600Kbps for HD(High Definition)

TRTCVideoResolution_1920_1080 Number

Aspect ratio: 16:9; resolution: 1920x1080; recommended bitrate (VideoCall): 2000 Kbps; recommended bitrate (LIVE): 3000 Kbps.

Video resolution

Here, only the landscape resolution (e.g., 640x360) is defined. If the portrait resolution (e.g., 360x640) needs to be used, Portrait must be selected for TRTCVideoResolutionMode.

Type:
  • Number

(constant) TRTCVideoResolutionMode :Number

Properties:
Name Type Description
TRTCVideoResolutionModeLandscape Number

横屏分辨率

TRTCVideoResolutionModePortrait Number

竖屏分辨率

Video aspect ratio mode

Only the landscape resolution (e.g., 640x360) is defined in TRTCVideoResolution. If the portrait resolution (e.g., 360x640) needs to be used, Portrait must be selected for TRTCVideoResolutionMode.

  • Landscape resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModeLandscape = 640x360.
  • Portrait resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModePortrait = 360x640.
Type:
  • Number

(constant) TRTCVideoStreamType :Number

Properties:
Name Type Description
TRTCVideoStreamTypeBig Number

HD big image: it is generally used to transfer video data from the camera.

TRTCVideoStreamTypeSmall Number

Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition.

TRTCVideoStreamTypeSub Number

Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream.

Video stream type

TRTC provides three different video streams, including:

  • HD big image: it is generally used to transfer video data from the camera.
  • Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition.
  • Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream.

Notice: The SDK does not support enabling the smooth small image alone, which must be enabled together with the big image. It will automatically set the resolution and bitrate of the small image.

Type:
  • Number

(constant) TRTCQuality :Number

Properties:
Name Type Description
TRTCQuality_Unknown Number

Undefined

TRTCQuality_Excellent Number

Excellent

TRTCQuality_Good Number

Good

TRTCQuality_Poor Number

Fair

TRTCQuality_Bad Number

Bad

TRTCQuality_Vbad Number

Very bad

TRTCQuality_Down Number

Down: Network cannot meet the minimum requirements of TRTC

Network quality

TRTC evaluates the current network quality once every two seconds. The evaluation results are divided into six levels: Excellent indicates the best, and Down indicates the worst.

Type:
  • Number

(constant) TRTCVideoFillMode :Number

Properties:
Name Type Description
TRTCVideoFillMode_Fill Number

Fill mode: the video image will be centered and scaled to fill the entire display area, where parts that exceed the area will be cropped. The displayed image may be incomplete in this mode.

TRTCVideoFillMode_Fit Number

Fit mode: the video image will be scaled based on its long side to fit the display area, where the short side will be filled with black bars. The displayed image is complete in this mode, but there may be black bars.

Video image fill mode

If the aspect ratio of the video display area is not equal to that of the video image, you need to specify the fill mode:

Type:
  • Number

(constant) TRTCVideoRotation :Number

Properties:
Name Type Description
TRTCVideoRotation0 Number

No rotation

TRTCVideoRotation90 Number

Clockwise rotation by 90 degrees

TRTCVideoRotation180 Number

Clockwise rotation by 180 degrees

TRTCVideoRotation270 Number

Clockwise rotation by 270 degrees

Video image rotation direction

TRTC provides rotation angle setting APIs for local and remote images. The following rotation angles are all clockwise.

Type:
  • Number

(constant) TRTCBeautyStyle :Number

Properties:
Name Type Description
TRTCBeautyStyleSmooth Number

Smooth style, which uses a more radical algorithm for more obvious effect and is suitable for show live streaming.

TRTCBeautyStyleNature Number

Natural style, which retains more facial details for more natural effect and is suitable for most live streaming use cases.

Beauty (skin smoothing) filter algorithm

TRTC has multiple built-in skin smoothing algorithms. You can select the one most suitable for your product.

Type:
  • Number

(constant) TRTCVideoPixelFormat :Number

Properties:
Name Type Description
TRTCVideoPixelFormat_Unknown Number

Undefined format

TRTCVideoPixelFormat_I420 Number

YUV420P (I420) format

TRTCVideoPixelFormat_Texture_2D Number

OpenGL 2D texture format

TRTCVideoPixelFormat_BGRA32 Number

BGRA32 format

TRTCVideoPixelFormat_RGBA32 Number

RGBA32 format

Video pixel format

TRTC provides custom video capturing and rendering features.

  • For the custom capturing feature, you can use the following enumerated values to describe the pixel format of the video you capture.
  • For the custom rendering feature, you can specify the pixel format of the video you expect the SDK to call back.
Type:
  • Number

(constant) TRTCVideoBufferType :Number

Properties:
Name Type Description
TRTCVideoBufferType_Unknown Number

Undefined transfer method

TRTCVideoBufferType_Buffer Number

Use memory buffer to transfer video data. iOS: PixelBuffer; Android: Direct Buffer for JNI layer; Windows: memory data block.

Video data transfer method

For custom capturing and rendering features, you need to use the following enumerated values to specify the method of transferring video data:

  • Method 1. This method uses memory buffer to transfer video data. It is the only method supported on Windows currently.
  • Method 2. This method uses texture to transfer video data. It is not supported on Windows. To use this method, you should have a general familiarity with OpenGL programming.
Type:
  • Number

(constant) TRTCVideoMirrorType :Number

Properties:
Name Type Description
TRTCVideoMirrorType_Auto Number

Auto mode: mirror the front camera's image but not the rear camera's image(for mobile devices only).

TRTCVideoMirrorType_Enable Number

Mirror the images of both the front and rear cameras.

TRTCVideoMirrorType_Disable Number

Disable mirroring for both the front and rear cameras.

Video mirror type

Video mirroring refers to the left-to-right flipping of the video image, especially for the local camera preview image. After mirroring is enabled, it can bring anchors a familiar "look into the mirror" experience.

Type:
  • Number

(constant) TRTCRecordType :Number

Properties:
Name Type Description
TRTCRecordTypeAudio Number

Record audio only.

TRTCRecordTypeVideo Number

Record video only.

TRTCRecordTypeBoth Number

Record both audio and video.

Media recording type

This enumerated type is used in the local media recording API startLocalRecording to specify whether to record audio/video files or pure audio files.

Type:
  • Number

TRTCRecordType[undefined]

Record audio only.

TRTCRecordType[undefined]

Record video only.

TRTCRecordType[undefined]

Record both audio and video.

(constant) TRTCAppScene :Number

Properties:
Name Type Description
TRTCAppSceneVideoCall Number

In the video call scenario, 720p and 1080p HD image quality is supported. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously. Use cases: [one-to-one video call], [video conferencing with up to 300 participants], [online medical diagnosis], [small class], [video interview], etc.

TRTCAppSceneLIVE Number

In the interactive video live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [low-latency interactive live streaming], [big class], [anchor competition], [video dating room], [online interactive classroom], [remote training], [large-scale conferencing], etc.

Notice: In this scenario, you must use the role field in TRTCParams to specify the role of the current user.

TRTCAppSceneAudioCall Number

Audio call scenario, where the SPEECH sound quality is used by default. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously. Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.

TRTCAppSceneVoiceChatRoom Number

In the interactive audio live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [audio club], [online karaoke room], [music live room], [FM radio], etc.

Notice: In this scenario, you must use the role field in TRTCParams to specify the role of the current user.

Use cases

TRTC features targeted optimizations for common audio/video application scenarios to meet the differentiated requirements in various verticals. The main scenarios can be divided into the following two categories:

  • Live streaming scenario (LIVE): including LIVE (audio + video) and VoiceChatRoom (pure audio). In the live streaming scenario, users are divided into two roles: "anchor" and "audience". A single room can sustain up to 100,000 concurrent online users. This is suitable for live streaming to a large audience.
  • Real-Time scenario (RTC): including VideoCall (audio + video) and AudioCall (pure audio). In the real-time scenario, there is no role difference between users, but a single room can sustain only up to 300 concurrent online users. This is suitable for small-scale real-time communication.
Type:
  • Number

(constant) TRTCRoleType :Number

Properties:
Name Type Description
TRTCRoleAnchor Number

Anchor

TRTCRoleAudience Number

Audience

Role

Role is applicable only to live streaming scenarios (TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom). Users are divided into two roles:

  • Anchor, who can publish their audio/video streams. There is a limit on the number of anchors. Up to 50 anchors are allowed to publish streams at the same time in one room.

  • Audience, who can only listen to or watch audio/video streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room can sustain up to 100,000 concurrent online users in the audience role.

  • Anchor: An anchor can publish their audio/video streams. There is a limit on the number of anchors. Up to 50 anchors are allowed to publish streams at the same time in one room.

  • Audience: Audience can only listen to or watch audio/video streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room can sustain up to 100,000 concurrent online users in the audience role.

Type:
  • Number

(constant) TRTCQosControlMode :Number

Properties:
Name Type Description
TRTCQosControlModeClient Number

ModeClient(Only for SDK internal test and debug)

TRTCQosControlModeServer Number

ModeServer(Default)

QoS control mode (deprecated)

The TRTC SDK adjusts the codec and network module constantly to adapt to changing network conditions. To support quick algorithm upgrade, the SDK provides two QoS control modes:

  • ModeClient: Local control, which is used for internal debugging of the SDK and is not recommended
  • ModeServer: Cloud control, which is the default mode and is recommended

We recommend the cloud control mode so that when we upgrade the QoS algorithm, you don’t need to update the SDK to get better QoS control results.

Type:
  • Number

(constant) TRTCVideoQosPreference :Number

Properties:
Name Type Description
TRTCVideoQosPreferenceSmooth Number

Ensuring smoothness

TRTCVideoQosPreferenceClear Number

Ensuring clarity (default value)

Image quality preference

TRTC has two control modes in weak network environments: "ensuring clarity" and "ensuring smoothness". Both modes will give priority to the transfer of audio data.

  • Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs.
  • Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags.
Type:
  • Number

(constant) TRTCAudioFrameFormat :Number

Properties:
Name Type Description
TRTCAudioFrameFormatNone Number

Undefined

TRTCAudioFrameFormatPCM Number

Audio data in PCM format.

Audio frame content format

Type:
  • Number

(constant) TRTCScreenCaptureSourceType :Number

Properties:
Name Type Description
TRTCScreenCaptureSourceTypeUnknown Number

Undefined

TRTCScreenCaptureSourceTypeWindow Number

The screen sharing target is the window of an application

TRTCScreenCaptureSourceTypeScreen Number

The screen sharing target is the entire screen

TRTCScreenCaptureSourceTypeCustom Number

The screen sharing target is a user-defined data source

Screen sharing target type

Type:
  • Number

(constant) TRTCAudioQuality :Number

Properties:
Name Type Description
TRTCAudioQualitySpeech Number

Speech mode: sample rate: 16 kHz; mono channel; bitrate: 16 Kbps. This mode has the best resistance among all modes and is suitable for audio call scenarios, such as online meeting and audio call.

TRTCAudioQualityDefault Number

Default mode: sample rate: 48 kHz; mono channel; bitrate: 50 Kbps. This mode is between the speech mode and the music mode as the default mode in the SDK and is recommended.

TRTCAudioQualityMusic Number

Music mode: sample rate: 48 kHz; full-band stereo; bitrate: 128 Kbps. This mode is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming.

Sound quality

TRTC provides three well-tuned modes to meet the differentiated requirements for sound quality in various verticals:

  • Speech mode (Speech): it is suitable for application scenarios that focus on human communication. In this mode, the audio transfer is more resistant, and TRTC uses various voice processing technologies to ensure the optimal smoothness even in weak network environments.
  • Music mode (Music): it is suitable for scenarios with demanding requirements for music. In this mode, the amount of transferred audio data is very large, and TRTC uses various technologies to ensure that the high-fidelity details of music signals can be restored in each frequency band.
  • Default mode (Default): it is between Speech and Music. In this mode, the reproduction of music is better than that in Speech mode, and the amount of transferred data is much lower than that in Music mode; therefore, this mode has good adaptability to various scenarios.
Type:
  • Number

(constant) TRTCLogLevel :Number

Properties:
Name Type Description
TRTCLogLevelVerbose Number

Output logs at all levels

TRTCLogLevelDebug Number

Output logs at the DEBUG, INFO, WARNING, ERROR, and FATAL levels

TRTCLogLevelInfo Number

Output logs at the INFO, WARNING, ERROR, and FATAL levels

TRTCLogLevelWarn Number

Output logs at the WARNING, ERROR, and FATAL levels

TRTCLogLevelError Number

Output logs at the ERROR and FATAL levels

TRTCLogLevelFatal Number

Output logs at the FATAL level

TRTCLogLevelNone Number

Do not output any SDK logs

Log level

Different log levels indicate different levels of details and number of logs. We recommend you set the log level to TRTCLogLevelInfo generally.

Type:
  • Number

(constant) TRTCDeviceState :Number

Properties:
Name Type Description
TRTCDeviceStateAdd Number

The device has been plugged in

TRTCDeviceStateRemove Number

The device has been removed

TRTCDeviceStateActive Number

The device has been enabled

TRTCDefaultDeviceChanged Number

System default device changed

Device operation

Type:
  • Number

(constant) TRTCDeviceType :Number

Properties:
Name Type Description
TRTCDeviceTypeUnknown Number

undefined device type

TRTCDeviceTypeMic Number

microphone

TRTCDeviceTypeSpeaker Number

speaker or earpiece

TRTCDeviceTypeCamera Number

camera

Device type

Type:
  • Number

(constant) TRTCCameraCaptureMode :Number

Properties:
Name Type Description
TRTCCameraResolutionStrategyAuto Number

Auto adjustment of camera acquisition parameters. SDK selects the appropriate camera output parameters according to the actual acquisition device performance and network situation, and maintains a balance between device performance and video preview quality.

TRTCCameraResolutionStrategyPerformance Number

Give priority to equipment performance. SDK selects the closest camera output parameters according to the user's encoder resolution and frame rate, so as to ensure the performance of the device.

TRTCCameraResolutionStrategyHighQuality Number

Give priority to the quality of video preview. SDK selects higher camera output parameters to improve the quality of preview video. In this case, it will consume more CPU and memory to do video preprocessing.

TRTCCameraCaptureManual Number

Allows the user to set the width and height of the video captured by the local camera.

Camera acquisition preferences

This enum is used to set camera acquisition parameters.

Type:
  • Number

(constant) TRTCWaterMarkSrcType :Number

Properties:
Name Type Description
TRTCWaterMarkSrcTypeFile Number

Path of the image file, which can be in BMP, GIF, JPEG, PNG, TIFF, Exif, WMF, or EMF format

TRTCWaterMarkSrcTypeBGRA32 Number

Memory block in BGRA32 format

TRTCWaterMarkSrcTypeRGBA32 Number

Memory block in RGBA32 format

Watermark image source type

Type:
  • Number

(constant) TRTCTranscodingConfigMode :Number

Properties:
Name Type Description
TRTCTranscodingConfigMode_Unknown Number

Undefined

TRTCTranscodingConfigMode_Manual Number

Manual layout mode In this mode, you need to specify the precise position of each video image. This mode has the highest degree of freedom, but its ease of use is the worst:

  • You need to enter all the parameters in TRTCTranscodingConfig, including the position coordinates of each video image (TRTCMixUser).
  • You need to listen on the onUserVideoAvailable() and onUserAudioAvailable() event callbacks in TRTCCloudDelegate and constantly adjust the mixUsers parameter according to the audio/video status of each user with mic on in the current room.
TRTCTranscodingConfigMode_Template_PureAudio Number

Pure audio mode This mode is suitable for pure audio scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom).

  • You only need to set it once through the setMixTranscodingConfig() API after room entry, and then the SDK will automatically mix the audio of all mic-on users in the room into the current user's live stream.
  • You don't need to set the mixUsers parameter in TRTCTranscodingConfig; instead, you only need to set the audioSampleRate, audioBitrate and audioChannels parameters.
TRTCTranscodingConfigMode_Template_PresetLayout Number

Preset layout mode This is the most popular layout mode, because it allows you to set the position of each video image in advance through placeholders, and then the SDK automatically adjusts it dynamically according to the number of video images in the room. In this mode, you still need to set the mixUsers parameter, but you can set userId as a "placeholder". Placeholder values include:

  • "$PLACE_HOLDER_REMOTE$": image of remote user. Multiple images can be set.
  • "$PLACE_HOLDER_LOCAL_MAIN$": local camera image. Only one image can be set.
  • "$PLACE_HOLDER_LOCAL_SUB$": local screen sharing image. Only one image can be set. In this mode, you don't need to listen on the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate to make real-time adjustments. Instead, you only need to call setMixTranscodingConfig() once after successful room entry. Then, the SDK will automatically populate the placeholders you set with real userId values.
TRTCTranscodingConfigMode_Template_ScreenSharing Number

Screen sharing mode This mode is suitable for screen sharing-based use cases such as online education and supported only by the SDKs for Windows and macOS. In this mode, the SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters).

  • Before the teacher enables screen sharing, the SDK will scale up the teacher's camera image and draw it onto the canvas.
  • After the teacher enables screen sharing, the SDK will draw the video image shared on the screen onto the same canvas. The purpose of this layout mode is to ensure consistency in the output resolution of the mixtranscoding module and avoid problems with blurred screen during course replay and webpage playback (web players don't support adjustable resolution). Meanwhile, the audio of mic-on students will be mixed into the teacher's audio/video stream by default.
    Video content is primarily the shared screen in teaching mode, and it is a waste of bandwidth to transfer camera image and screen image at the same time. Therefore, the recommended practice is to directly draw the camera image onto the current screen through the setLocalVideoRenderCallback API. In this mode, you don't need to set the mixUsers parameter in TRTCTranscodingConfig, and the SDK will not mix students' images so as not to interfere with the screen sharing effect.
    You can set width x height in TRTCTranscodingConfig to 0 px x 0 px, and the SDK will automatically calculate a suitable resolution based on the aspect ratio of the user's current screen.
  • If the teacher's current screen width is less than or equal to 1920 px, the SDK will use the actual resolution of the teacher's current screen.
  • If the teacher's current screen width is greater than 1920 px, the SDK will select one of the three resolutions of 1920x1080 (16:9), 1920x1200 (16:10), and 1920x1440 (4:3) according to the current screen aspect ratio.

Layout mode of On-Cloud MixTranscoding

TRTC's On-Cloud MixTranscoding service can mix multiple audio/video streams in the room into one stream. Therefore, you need to specify the layout scheme of the video images. The following layout modes are provided:

Type:
  • Number

(constant) TRTCMixInputType :Number

Properties:
Name Type Description
TRTCMixInputTypeUndefined Number

Unspecified. The SDK will determine the stream mix input type according to the value of the pureAudio parameter

TRTCMixInputTypeAudioVideo Number

Mix both audio and video

TRTCMixInputTypePureVideo Number

Mix video only

TRTCMixInputTypePureAudio Number

Mix audio only

TRTCMixInputTypeWatermark Number

Mix watermark. In this case, you don't need to specify the userId parameter, but you need to specify the image parameter. It is recommended to use png format.

Stream mix input type

Type:
  • Number

(constant) TRTCAudioRecordingContent :Number

Properties:
Name Type Description
TRTCAudioRecordingContentAll Number

Record both local and remote audio

TRTCAudioRecordingContentLocal Number

Record local audio only

TRTCAudioRecordingContentRemote Number

Record remote audio only

Audio recording content type

** Supported from TRTCSDK 9.3 **

This enumerated type is used in the audio recording API startAudioRecording() to specify the content of the recorded audio.

Type:
  • Number

(constant) TRTCVoiceReverbType :Number

Properties:
Name Type Description
TRTCLiveVoiceReverbType_0 Number

disable

TRTCLiveVoiceReverbType_1 Number

KTV

TRTCLiveVoiceReverbType_2 Number

small room

TRTCLiveVoiceReverbType_3 Number

great hall

TRTCLiveVoiceReverbType_4 Number

deep voice

TRTCLiveVoiceReverbType_5 Number

loud voice

TRTCLiveVoiceReverbType_6 Number

metallic sound

TRTCLiveVoiceReverbType_7 Number

magnetic sound

TRTCLiveVoiceReverbType_8 Number

ethereal

TRTCLiveVoiceReverbType_9 Number

studio

TRTCLiveVoiceReverbType_10 Number

melodious

TRTCLiveVoiceReverbType_11 Number

studio2

Reverb effects

Reverb effects can be applied to human voice. Based on acoustic algorithms, they can mimic voice in different environments. The following effects are supported currently:

Type:
  • Number

(constant) TRTCVoiceChangerType :Number

Properties:
Name Type Description
TRTCLiveVoiceChangerType_0 Number

disable

TRTCLiveVoiceChangerType_1 Number

Naughty child

TRTCLiveVoiceChangerType_2 Number

Lolita

TRTCLiveVoiceChangerType_3 Number

Uncle

TRTCLiveVoiceChangerType_4 Number

Heavy Metal

TRTCLiveVoiceChangerType_5 Number

Influenza

TRTCLiveVoiceChangerType_6 Number

Foreign Language

TRTCLiveVoiceChangerType_7 Number

Trapped Beast

TRTCLiveVoiceChangerType_8 Number

Plump

TRTCLiveVoiceChangerType_9 Number

Heavy Current

TRTCLiveVoiceChangerType_10 Number

Heavy Machinery

TRTCLiveVoiceChangerType_11 Number

Intangible

Voice change effects

Voice change effects can be applied to the human voice, and the acoustic algorithm can process the human voice twice to obtain the timbre different from the original sound. Currently, the following kinds of acoustic effects are supported

Type:
  • Number

(constant) TRTCPluginType :Number

Properties:
Name Type Description
TRTCPluginTypeVideoProcess Number

Video processing plugin type, useful for customized beauty such as AI beauty

TRTCPluginTypeMediaEncryptDecrypt Number

Media encryption and decryption, useful for customized security

TRTCPluginTypeAudioProcess Number

audio processing plugin type, useful for custom audio processing

Plugin Type

Support video processing plugin and media encryption and decryption plugin

Type:
  • Number

Type Definitions

TRTCAudioParallelParams

Properties:
Name Type Description
maxCount Number

[Field Meaning] Maximum number of parallel playback. Default value: 0.

  • If maxCount > 0 and the actual number of people > maxCount, the SDK will intelligently select maxCount routes of data for playback in real-time, which will greatly reduce performance consumption.
  • If maxCount = 0, the SDK does not limit the number of parallel playback. This may trigger performance issues in rooms with many people on the mic.
includeUsers Array.<String>

[Field Meaning] Specifies users who must be able to play back in parallel.
[Special Instructions] Specifies the user ID list that must be played back in parallel. These users do not participate in intelligent selection.

  • The number of includeUsers must be less than maxCount, otherwise the parallel playback setting will be invalid.
  • includeUsers is only valid when maxCount > 0. When includeUsers takes effect, the maximum number of parallel playback participants in intelligent selection = maxCount - the number of valid includeUsers.

Parameters for the intelligent parallel playback strategy of remote audio streams

This parameter is used to set up the intelligent parallel playback strategy for remote audio streams.

Type:
  • Object

TRTCCameraCaptureParams

Properties:
Name Type Description
mode TRTCCameraCaptureMode

Acquisition mode

width Number

Acquisition width

height Number

Acquisition height

Camera acquisition parameters

This setting determines the quality of the local preview image.

Type:
  • Object

TRTCPluginInfo

Properties:
Name Type Description
id String

plugin ID. User should be sure that it is unique for each plugin.

deviceId String

camera device ID. Required when you open multi-camera for customized beauty. Default is empty string.

enable function

enable current plugin. Success when return 0, otherwise failed.

disable function

disable current plugin. Success when return 0, otherwise failed.

setParameter function

set parameter to control plugin. Success when return 0, otherwise failed. The parameter is a JSON string and will be passed to C++ plugin's setParameter function.

TRTC plugin information

Type:
  • Object

TRTCVideoProcessPluginOptions

Properties:
Name Type Description
enable Boolean

Whether to enable

pixelFormat TRTCVideoPixelFormat

Pixel format

Video processing plugin options

Type:
  • Object

TRTCMediaEncryptDecryptPluginOptions

Properties:
Name Type Description
enable Boolean

Whether to enable

Media encryption and decryption plugin options

Type:
  • Object

TRTCAudioProcessPluginOptions

Properties:
Name Type Description
enable Boolean

Whether to enable

Audio process plugin options

Type:
  • Object

TRTCMusicPlayObserver

Properties:
Name Type Description
onStart TRTCMusicEvent~onStart | null

Background music started event

onPlayProgress TRTCMusicEvent~onPlayProgress | null

Background music playing progress event

onComplete TRTCMusicEvent~onComplete | null

Background music completed event

Background music playing event observer

Type:
  • Object

TRTCMusicPreloadObserver

Properties:
Name Type Description
onLoadProgress TRTCMusicEvent~onLoadProgress | null

Background music preloading progress event

onLoadError TRTCMusicEvent~onLoadError | null

Background music preloading error

Background music preloading event observer

Type:
  • Object

TRTCAudioFrameCallback

Properties:
Name Type Description
onCapturedAudioFrame TRTCAudioFrameCallback~onCapturedAudioFrame | null

Audio data captured by the local mic and pre-processed by the audio module.

onLocalProcessedAudioFrame TRTCAudioFrameCallback~onLocalProcessedAudioFrame | null

Audio data captured by the local mic, pre-processed by the audio module, effect-processed and BGM-mixed.

onPlayAudioFrame TRTCAudioFrameCallback~onPlayAudioFrame | null

Audio data of each remote user before audio mixing.

onMixedPlayAudioFrame TRTCAudioFrameCallback~onMixedPlayAudioFrame | null

Data mixed from each channel before being submitted to the system for playback.

onMixedAllAudioFrame TRTCAudioFrameCallback~onMixedAllAudioFrame | null

Data mixed from all the captured and to-be-played audio in the SDK.

Callback of custom audio processing

Type:
  • Object