Audio sample rate is an indicator of audio fidelity. A higher sample rate indicates higher fidelity. If your application scenario involves music, we recommend that you use TRTCAudioSampleRate48000.
16 kHz sample rate
Static TRTCAudioSampleRate32000
TRTCAudioSampleRate32000:number = 32000
32 kHz sample rate
Static TRTCAudioSampleRate44100
TRTCAudioSampleRate44100:number = 44100
44.1 kHz sample rate
Static TRTCAudioSampleRate48000
TRTCAudioSampleRate48000:number = 48000
48 kHz sample rate
Static TRTCRoleAnchor
TRTCRoleAnchor:number = 20
Anchor
Static TRTCRoleAudience
TRTCRoleAudience:number = 21
Audience
Static TRTCSystemVolumeTypeAuto
TRTCSystemVolumeTypeAuto:number = 0
Call volume is used for anchors and media volume for audience (not co-anchoring). This mode is suitable for live streaming scenarios.
If you set the scenario to TRTC_APP_SCENE_LIVE or TRTC_APP_SCENE_VOICE_CHATROOM when calling enterRoom, the SDK will use this mode by default.
Static TRTCSystemVolumeTypeMedia
TRTCSystemVolumeTypeMedia:number = 1
Media volume is used throughout a call. This mode is not used often, only under special circumstances such as when the anchor uses an external sound card.
Static TRTCSystemVolumeTypeVOIP
TRTCSystemVolumeTypeVOIP:number = 2
Call volume is used throughout a call. This is suitable for conferencing scenarios.
If you set the scenario to TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL when calling enterRoom, the SDK will use this mode by default.
Static TRTC_APP_SCENE_AUDIOCALL
TRTC_APP_SCENE_AUDIOCALL:number = 2
Audio calls support 48 kHz stereo audio. Each room allows up to 300 concurrent 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.
Static TRTC_APP_SCENE_LIVE
TRTC_APP_SCENE_LIVE:number = 1
Interactive live video streaming allows smooth mic on/off without waiting. Anchor latency is lower than 300 ms and playback latency lower than 1,000 ms. Up to 100,000 users can play the anchor’s video at the same time.
Use cases: [low-latency live video streaming], [interactive classroom for up to 100,000 participants], [live video competition], [video dating room], [remote training], [large-scale conferencing], etc.
Note: In this scenario, you must specify a role for the user via the role parameter in TRTCParams.
Static TRTC_APP_SCENE_VIDEOCALL
TRTC_APP_SCENE_VIDEOCALL:number = 0
Video calls support 720p and 1080p HD video. Each room allows up to 300 concurrent 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 consultation], [video chat], [video interview], etc.
Static TRTC_APP_SCENE_VOICE_CHATROOM
TRTC_APP_SCENE_VOICE_CHATROOM:number = 3
Interactive live audio streaming allows smooth mic on/off without waiting. Anchor latency is lower than 300 ms and playback latency lower than 1,000 ms. Up to 100,000 users can play the anchor’s audio at the same time.
Use cases: [low-latency live audio streaming], [live audio co-anchoring], [audio chat room], [karaoke room], [FM radio], etc.
Note: In this scenario, you must specify a role for the user via the role parameter in TRTCParams.
Static TRTC_AUDIO_FRAME_FORMAT_PCM
TRTC_AUDIO_FRAME_FORMAT_PCM:number = 1
PCM
Static TRTC_AUDIO_QUALITY_DEFAULT
TRTC_AUDIO_QUALITY_DEFAULT:number = 2
Default: mono audio with a sample rate of 48 kHz and a bitrate of 50 Kbps. This is the default audio quality used by the SDK and is recommended.
Static TRTC_AUDIO_QUALITY_MUSIC
TRTC_AUDIO_QUALITY_MUSIC:number = 3
Music: stereo and fullband audio with a sample rate of 48 kHz and a bitrate of 128 Kbps, suitable for music scenarios with high requirements on fidelity, such as karaoke and live music streaming
Static TRTC_AUDIO_QUALITY_SPEECH
TRTC_AUDIO_QUALITY_SPEECH:number = 1
Speech: mono audio with a sample rate of 16 kHz and a bitrate of 16 Kbps, suitable for online conferencing, audio calls, etc.
Static TRTC_AUDIO_ROUTE_EARPIECE
TRTC_AUDIO_ROUTE_EARPIECE:number = 1
Receiver
Static TRTC_AUDIO_ROUTE_SPEAKER
TRTC_AUDIO_ROUTE_SPEAKER:number = 0
Speaker
Static TRTC_BEAUTY_STYLE_NATURE
TRTC_BEAUTY_STYLE_NATURE:number = 1
Natural, which retains more facial details and is more natural
Static TRTC_BEAUTY_STYLE_PITU
TRTC_BEAUTY_STYLE_PITU:number = 2
Pitu style, which is more natural and retains more facial details than the smooth style
Static TRTC_BEAUTY_STYLE_SMOOTH
TRTC_BEAUTY_STYLE_SMOOTH:number = 0
Smooth, which features more obvious skin smoothing effect and is suitable for showrooms
Static TRTC_DEBUG_VIEW_LEVEL_ALL
TRTC_DEBUG_VIEW_LEVEL_ALL:number = 2
The upper part of the UI displays the status logs, and the lower part displays the key events
Static TRTC_DEBUG_VIEW_LEVEL_GONE
TRTC_DEBUG_VIEW_LEVEL_GONE:number = 0
The UI doesn't display logs
Static TRTC_DEBUG_VIEW_LEVEL_STATUS
TRTC_DEBUG_VIEW_LEVEL_STATUS:number = 1
The upper part of the UI displays the status logs
Static TRTC_GSENSOR_MODE_DISABLE
TRTC_GSENSOR_MODE_DISABLE:number = 0
Disable the G-sensor
Static TRTC_GSENSOR_MODE_UIAUTOLAYOUT
TRTC_GSENSOR_MODE_UIAUTOLAYOUT:number = 1
Enable the G-sensor (default)
Static TRTC_GSENSOR_MODE_UIFIXLAYOUT
TRTC_GSENSOR_MODE_UIFIXLAYOUT:number = 2
The same as UIAutoLayout and to be disused
Static TRTC_LOG_LEVEL_DEBUG
TRTC_LOG_LEVEL_DEBUG:number = 1
Output DEBUG, INFO, WARNING, ERROR, and FATAL logs
Static TRTC_LOG_LEVEL_ERROR
TRTC_LOG_LEVEL_ERROR:number = 4
Output ERROR and FATAL logs
Static TRTC_LOG_LEVEL_FATAL
TRTC_LOG_LEVEL_FATAL:number = 5
Output FATAL logs
Static TRTC_LOG_LEVEL_INFO
TRTC_LOG_LEVEL_INFO:number = 2
Output INFO, WARNING, ERROR, and FATAL logs
Static TRTC_LOG_LEVEL_NULL
TRTC_LOG_LEVEL_NULL:number = 6
Off
Static TRTC_LOG_LEVEL_VERBOSE
TRTC_LOG_LEVEL_VERBOSE:number = 0
Output all logs
Static TRTC_LOG_LEVEL_WARN
TRTC_LOG_LEVEL_WARN:number = 3
Output WARNING, ERROR, and FATAL logs
Static TRTC_QUALITY_Bad
TRTC_QUALITY_Bad:number = 4
Bad
Static TRTC_QUALITY_Down
TRTC_QUALITY_Down:number = 6
Unavailable
Static TRTC_QUALITY_Excellent
TRTC_QUALITY_Excellent:number = 1
Excellent
Static TRTC_QUALITY_Good
TRTC_QUALITY_Good:number = 2
Good
Static TRTC_QUALITY_Poor
TRTC_QUALITY_Poor:number = 3
Mediocre
Static TRTC_QUALITY_UNKNOWN
TRTC_QUALITY_UNKNOWN:number = 0
Unknown
Static TRTC_QUALITY_Vbad
TRTC_QUALITY_Vbad:number = 5
Very bad
Static TRTC_REVERB_TYPE_0
TRTC_REVERB_TYPE_0:number = 0
Off
Static TRTC_REVERB_TYPE_1
TRTC_REVERB_TYPE_1:number = 1
Karaoke
Static TRTC_REVERB_TYPE_2
TRTC_REVERB_TYPE_2:number = 2
Room
Static TRTC_REVERB_TYPE_3
TRTC_REVERB_TYPE_3:number = 3
Hall
Static TRTC_REVERB_TYPE_4
TRTC_REVERB_TYPE_4:number = 4
Deep
Static TRTC_REVERB_TYPE_5
TRTC_REVERB_TYPE_5:number = 5
Resonant
Static TRTC_REVERB_TYPE_6
TRTC_REVERB_TYPE_6:number = 6
Metallic
Static TRTC_REVERB_TYPE_7
TRTC_REVERB_TYPE_7:number = 7
Husky
Static TRTC_SDK_VERSION
TRTC_SDK_VERSION:String = '0.0.0.0'
Static TRTC_TranscodingConfigMode_Manual
TRTC_TranscodingConfigMode_Manual:number = 1
Manual mode. This mode is the most flexible, allowing you to mix streams as needed, but it is the most difficult to use.
In this mode, you need to specify all the parameters in TRTCTranscodingConfig and listen for the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate.
The callbacks keep you up to date about the users who are sending audio and video in the room so that you can modify the mixUsers parameter accordingly. Otherwise, mixtranscoding will fail.
Preset layout mode, which allows you to set the layout of images in advance through placeholders
In this mode, you need to set the mixUsers parameter and can use the following placeholders for userId.
$PLACE_HOLDER_REMOTE$: the image of a remote user. You can use this placeholder for multiple users.
$PLACE_HOLDER_LOCAL_MAIN$: the local camera image. You can use this placeholder for only one user.
$PLACE_HOLDER_LOCAL_SUB$: the local screen sharing image. You can use this placeholder for only one user.
You don't need to listen for the onUserVideoAvailable() or onUserAudioAvailable() callback in TRTCCloudDelegate.
Just call setMixTranscodingConfig() once after successful room entry, and the SDK will automatically replace the placeholders with actual userId values.
Audio-only mode, which is suitable for audio-only scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom)
You only need to set the mode once through the setMixTranscodingConfig() API after room entry, and the SDK will automatically mix the audios of all mic-on users in the room into the current user's stream.
In this mode, you only need to set audioSampleRate, audioBitrate, and audioChannels in TRTCTranscodingConfig, not mixUsers.
Screen sharing mode, which is suitable for scenarios such as online education. This mode is supported only by the SDK for Windows and macOS.
The SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters).
When the teacher is not sharing his or her screen, the SDK stretches the teacher’s camera image to fit the canvas. After the teacher enables screen sharing, the SDK does the same to the screen sharing image.
This ensures consistency in the resolution of the mixed stream and prevents video pixelation during replay and web-based streaming (web players cannot play videos with changing resolution).
Meanwhile, the audios of mic-on students will be mixed into the teacher's audio/video stream.
Given that screen sharing images are the main content in education scenarios, publishing both the camera and screen sharing images would be a waste of bandwidth.
We recommend that you use setLocalVideoRenderCallback() to draw the camera image onto the shared screen.
In this mode, you don't need to set the mixUsers parameter in TRTCTranscodingConfig. For better screen sharing experience, the SDK does not mix students' images.
You can set both width and height in TRTCTranscodingConfig to 0, and the SDK will work out an appropriate resolution based on the user’s screen size.
If the teacher's screen width is 1920 px or smaller, the SDK will use the actual resolution of the teacher's screen.
If the teacher's screen width is greater than 1920 px, the SDK will use 1920 × 1080 (16:9), 1920 × 1200 (16:10), or 1920 × 1440 (4:3).
Prioritize clarity under poor network conditions (default)
Static TRTC_VIDEO_QOS_PREFERENCE_SMOOTH
TRTC_VIDEO_QOS_PREFERENCE_SMOOTH:number = 1
name
2.4 Video quality preference
You can specify whether to prioritize clarity or smoothness under poor network conditions. Both modes give top priority to the transfer of audio data.
Smooth: This mode prioritizes smoothness on a weak network. If a user's network connection is poor, the video will become blurry.
Clear: This mode (default) prioritizes clarity on a weak network. If a user's network connection is poor, the video will stutter, but its definition won’t drop dramatically.
Prioritize smoothness under poor network conditions
Static TRTC_VIDEO_RENDER_MODE_FILL
TRTC_VIDEO_RENDER_MODE_FILL:number = 0
The image is scaled to fill the entire screen, and the excess parts are cropped.
Static TRTC_VIDEO_RENDER_MODE_FIT
TRTC_VIDEO_RENDER_MODE_FIT:number = 1
The long side of the image is stretched to fit the screen, and the blank area is filled with black bars.
Static TRTC_VIDEO_RESOLUTION_120_120
TRTC_VIDEO_RESOLUTION_120_120:number = 1
Only landscape resolutions are defined below. To use portrait resolutions (e.g., 360 × 640), set TRTCVideoResolutionMode to Portrait.
Recommended bitrate: 80 Kbps for VideoCall, 120 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_1280_720
TRTC_VIDEO_RESOLUTION_1280_720:number = 112
Recommended bitrate: 1200 Kbps for VideoCall, 1800 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_160_120
TRTC_VIDEO_RESOLUTION_160_120:number = 50
Recommended bitrate: 100 Kbps for VideoCall, 150 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_160_160
TRTC_VIDEO_RESOLUTION_160_160:number = 3
Recommended bitrate: 100 Kbps for VideoCall, 150 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_160_90
TRTC_VIDEO_RESOLUTION_160_90:number = 100
Recommended bitrate: 150 Kbps for VideoCall, 250 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_1920_1080
TRTC_VIDEO_RESOLUTION_1920_1080:number = 114
Recommended bitrate: 2000 Kbps for VideoCall, 3000 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_240_180
TRTC_VIDEO_RESOLUTION_240_180:number = 52
Recommended bitrate: 150 Kbps for VideoCall, 225 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_256_144
TRTC_VIDEO_RESOLUTION_256_144:number = 102
Recommended bitrate: 200 Kbps for VideoCall, 300 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_270_270
TRTC_VIDEO_RESOLUTION_270_270:number = 5
Recommended bitrate: 200 Kbps for VideoCall, 120 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_280_210
TRTC_VIDEO_RESOLUTION_280_210:number = 54
Recommended bitrate: 200 Kbps for VideoCall, 300 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_320_180
TRTC_VIDEO_RESOLUTION_320_180:number = 104
Recommended bitrate: 250 Kbps for VideoCall, 400 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_320_240
TRTC_VIDEO_RESOLUTION_320_240:number = 56
Recommended bitrate: 250 Kbps for VideoCall, 375 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_400_300
TRTC_VIDEO_RESOLUTION_400_300:number = 58
Recommended bitrate: 300 Kbps for VideoCall, 450 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_480_270
TRTC_VIDEO_RESOLUTION_480_270:number = 106
Recommended bitrate: 350 Kbps for VideoCall, 550 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_480_360
TRTC_VIDEO_RESOLUTION_480_360:number = 60
Recommended bitrate: 400 Kbps for VideoCall, 600 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_480_480
TRTC_VIDEO_RESOLUTION_480_480:number = 7
Recommended bitrate: 350 Kbps for VideoCall, 120 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_640_360
TRTC_VIDEO_RESOLUTION_640_360:number = 108
Recommended bitrate: 550 Kbps for VideoCall, 900 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_640_480
TRTC_VIDEO_RESOLUTION_640_480:number = 62
Recommended bitrate: 600 Kbps for VideoCall, 900 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_960_540
TRTC_VIDEO_RESOLUTION_960_540:number = 110
Recommended bitrate: 850 Kbps for VideoCall, 1300 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_960_720
TRTC_VIDEO_RESOLUTION_960_720:number = 64
Recommended bitrate: 1000 Kbps for VideoCall, 1500 Kbps for LIVE
Static TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE
TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE:number = 0
Landscape resolution
Static TRTC_VIDEO_RESOLUTION_MODE_PORTRAIT
TRTC_VIDEO_RESOLUTION_MODE_PORTRAIT:number = 1
Portrait resolution
Static TRTC_VIDEO_ROTATION_0
TRTC_VIDEO_ROTATION_0:number = 0
Do not rotate
Static TRTC_VIDEO_ROTATION_180
TRTC_VIDEO_ROTATION_180:number = 2
Rotate 180 degrees clockwise
Static TRTC_VIDEO_ROTATION_270
TRTC_VIDEO_ROTATION_270:number = 3
Rotate 270 degrees clockwise
Static TRTC_VIDEO_ROTATION_90
TRTC_VIDEO_ROTATION_90:number = 1
Rotate 90 degrees clockwise
Static TRTC_VIDEO_STREAM_TYPE_BIG
TRTC_VIDEO_STREAM_TYPE_BIG:number = 0
Big-image stream
Static TRTC_VIDEO_STREAM_TYPE_SMALL
TRTC_VIDEO_STREAM_TYPE_SMALL:number = 1
Small-image stream
Static TRTC_VIDEO_STREAM_TYPE_SUB
TRTC_VIDEO_STREAM_TYPE_SUB:number = 2
Substream (screen sharing)
Static TRTC_VOICE_CHANGER_TYPE_0
TRTC_VOICE_CHANGER_TYPE_0:number = 0
Off
Static TRTC_VOICE_CHANGER_TYPE_1
TRTC_VOICE_CHANGER_TYPE_1:number = 1
Child
Static TRTC_VOICE_CHANGER_TYPE_10
TRTC_VOICE_CHANGER_TYPE_10:number = 10
Robot
Static TRTC_VOICE_CHANGER_TYPE_11
TRTC_VOICE_CHANGER_TYPE_11:number = 11
Ethereal
Static TRTC_VOICE_CHANGER_TYPE_2
TRTC_VOICE_CHANGER_TYPE_2:number = 2
Little girl
Static TRTC_VOICE_CHANGER_TYPE_3
TRTC_VOICE_CHANGER_TYPE_3:number = 3
Middle-aged man
Static TRTC_VOICE_CHANGER_TYPE_4
TRTC_VOICE_CHANGER_TYPE_4:number = 4
Metal
Static TRTC_VOICE_CHANGER_TYPE_5
TRTC_VOICE_CHANGER_TYPE_5:number = 5
Nasal
Static TRTC_VOICE_CHANGER_TYPE_6
TRTC_VOICE_CHANGER_TYPE_6:number = 6
Punk
Static TRTC_VOICE_CHANGER_TYPE_7
TRTC_VOICE_CHANGER_TYPE_7:number = 7
Beast
Static TRTC_VOICE_CHANGER_TYPE_8
TRTC_VOICE_CHANGER_TYPE_8:number = 8
Otaku
Static TRTC_VOICE_CHANGER_TYPE_9
TRTC_VOICE_CHANGER_TYPE_9:number = 9
Electronic
Static TRTC_VideoView_SurfaceView
TRTC_VideoView_SurfaceView:number = 2
Use SurfaceView for Android video rendering
Static TRTC_VideoView_TextureView
TRTC_VideoView_TextureView:number = 1
Use TextureView for Android video rendering
Static VIDEO_QOS_CONTROL_CLIENT
VIDEO_QOS_CONTROL_CLIENT:number = 0
Local control, which is for internal debugging of the SDK and is not recommended