tencent cloud

Mobile Live Video Broadcasting

Release Notes and Announcements
TUILiveKit Release Notes
Live SDK Release Notes
User Guide
Product Introduction
Overview
Strengths
Performance Statistics
Concepts
Purchase Guide
TRTC Live Billing Overview
Billing of Video Live Component
Activating the Service (TUILiveKit)
Free Demo
Demo
Run Demo(TUILiveKit)
Integration Guide
Video Live Streaming
Preparation
Host Live Streaming
Audience Viewing
Live Stream List Live Stream List
Voice Chat Room
Preparation
Host Live Streaming
Audience Viewing
Live Stream List
Live Streaming Kit
Live Streaming Kit(Electron Desktop Application)
Live Streaming Kit(Web Desktop Browser)
Live Broadcast Monitoring
Monitoring Webpage (Web Desktop Browser React)
Monitoring Webpage (Web Desktop Browser Vue)
UI Customization
Live Stream Video Component
Video Source Editing Canvas
Audience List Component
Barrage Component
Media Source Configuration Panel
Link Management Panel
Live Gift Component
No UI Integration
Video Live Streaming
Voice Chat Room
Feature Guide
Follow Anchors (TUILiveKit)
Ultimate Image Quality (TUILiveKit)
Push Media Stream Into Room (TUILiveKit)
Gift System (TUILiveKit)
Client APIs
Android
iOS
Web
Server APIs (TUILiveKit)
Account System
REST API
Third-Party Webhooks
Error Codes (TUILiveKit)
FAQs
Platform Compilation
User Authentication
Live SDK
Product Introduction
Purchase Guide
Free Demo
Free Trial License
SDK Download
Licenses
Advanced Features
Client API
FAQs
Integration (No UI)
API Documentation
OSS information
OSS Attribution Notice

V2TXLivePremier

포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-03-27 17:23:04
Copyright (c) 2021 Tencent. All rights reserved.

Module: V2TXLivePremier @ TXLiteAVSDK

Function: V2TXLive High-level interface

V2TXLivePremier

V2TXLivePremierObserver

FuncList
DESC
Custom Log output callback interface
setLicence result callback interface
Raw audio data captured locally
Data mixed from each channel before being submitted to the system for playback
In-ear monitoring data

V2TXLivePremier

FuncList
DESC
Get the SDK version number
Set V2TXLivePremier callback interface
Set Log configuration information
Set up SDK access environment
Set SDK authorization license
Set SDK socks5 proxy config
Enables/Disables audio capture callback
Enables/Disables audio playout callback
Enables/Disables in-ear monitoring callback
Set user id
Call experimental APIs

onLog

onLog
void onLog
(int level

String log)
Custom Log output callback interface

onLicenceLoaded

onLicenceLoaded
void onLicenceLoaded
(int result

String reason)
setLicence result callback interface
Param
DESC
reason
the reason for failure.
result
the result of setLicence interface, 0 succeeds, negative number fails.

onCaptureAudioFrame

onCaptureAudioFrame
void onCaptureAudioFrame
(V2TXLiveDef.V2TXLiveAudioFrame frame)
Raw audio data captured locally
Param
DESC
frame
Audio frames in PCM format.
Note
1. Please avoid time-consuming operations in this callback function. The SDK processes an audio frame every 20 ms, so if your operation takes more than 20 ms, it will cause audio exceptions.
2. The audio data returned via this callback can be read and modified, but please keep the duration of your operation short.
3. The audio data returned via this callback does not include pre-processing effects like background music, audio effects, or reverb, and therefore has a very short delay.

onPlayoutAudioFrame

onPlayoutAudioFrame
void onPlayoutAudioFrame
(V2TXLiveDef.V2TXLiveAudioFrame frame)
Data mixed from each channel before being submitted to the system for playback
After you configure the callback of custom audio processing, the SDK will return to you via this callback the data (PCM format) mixed from each channel before it is submitted to the system for playback.
The audio data returned via this callback is in PCM format and has a fixed frame length (time) of 0.02s.
The formula to convert a frame length in seconds to one in bytes is sample rate * frame length in seconds * number of sound channels * audio bit depth.
Assume that the audio is recorded on a single channel with a sample rate of 48,000 Hz and audio bit depth of 16 bits, which are the default settings of SDK. The frame length in bytes will be 48000 * 0.02s * 1 * 16 bits = 15360 bits = 1920 bytes.
Param
DESC
frame
Audio frames in PCM format.
Note
1. Please avoid time-consuming operations in this callback function. The SDK processes an audio frame every 20 ms, so if your operation takes more than 20 ms, it will cause audio exceptions.
2. The audio data returned via this callback can be read and modified, but please keep the duration of your operation short.
3. The audio data returned via this callback is the audio data mixed from each channel before it is played. It does not include the in-ear monitoring data.

onVoiceEarMonitorAudioFrame

onVoiceEarMonitorAudioFrame
void onVoiceEarMonitorAudioFrame
(V2TXLiveDef.V2TXLiveAudioFrame frame)
In-ear monitoring data
After you configure the callback of custom audio processing, the SDK will return to you via this callback the in-ear monitoring data (PCM format) before it is submitted to the system for playback.
The audio returned is in PCM format and has a not-fixed frame length (time).
The formula to convert a frame length in seconds to one in bytes is sample rate * frame length in seconds * number of sound channels * audio bit depth.
Assume that the audio is recorded on a single channel with a sample rate of 48,000 Hz and audio bit depth of 16 bits, which are the default settings of TRTC. The length of 0.02s frame in bytes will be 48000 * 0.02s * 1 * 16 bits = 15360 bits = 1920 bytes.
Param
DESC
frame
Audio frames in PCM format
Note
1. Please avoid time-consuming operations in this callback function, or it will cause audio exceptions.
2. The audio data returned via this callback can be read and modified, but please keep the duration of your operation short.

getSDKVersionStr

getSDKVersionStr
Get the SDK version number

setObserver

setObserver
void setObserver
(V2TXLivePremierObserver observer)
Set V2TXLivePremier callback interface

setLogConfig

setLogConfig
void setLogConfig
(V2TXLiveDef.V2TXLiveLogConfig config)
Set Log configuration information

setEnvironment

setEnvironment
void setEnvironment
(String env)
Set up SDK access environment
Param
DESC
env
currently supports two parameters "default" and "GDPR".
default: In the default environment, the SDK will find the best access point in the world for access.
GDPR: All audio and video data and quality statistics will not pass through servers in mainland China.
Note
If your application has no special requirements, please do not call this interface for setting.

setLicence

setLicence
void setLicence
(Context context

String url

String key)
Set SDK authorization license

Try and Purchase a License: https://www.tencentcloud.com/document/product/1071/38546.
Param
DESC
context

key
the key of licence.
url
the url of licence.

setSocks5Proxy

setSocks5Proxy
void setSocks5Proxy
(String host

int port

String username

String password

V2TXLiveDef.V2TXLiveSocks5ProxyConfig config)
Set SDK socks5 proxy config
Param
DESC
config
protocol configured with socks5 proxy.
host
socks5 proxy host.
password
socks5 proxy password.
port
socks5 proxy port.
username
socks5 proxy username.

enableAudioCaptureObserver

enableAudioCaptureObserver
void enableAudioCaptureObserver
(boolean enable

V2TXLiveDef.V2TXLiveAudioFrameObserverFormat format)
Enables/Disables audio capture callback
Param
DESC
enable
true : enable; false (default): disable.
format
audio frame format.
Note
This API works only if you call it before startPush.

enableAudioPlayoutObserver

enableAudioPlayoutObserver
void enableAudioPlayoutObserver
(boolean enable

V2TXLiveDef.V2TXLiveAudioFrameObserverFormat format)
Enables/Disables audio playout callback
Param
DESC
enable
true : enable; false (default): disable.
format
audio frame format.

enableVoiceEarMonitorObserver

enableVoiceEarMonitorObserver
void enableVoiceEarMonitorObserver
(boolean enable)
Enables/Disables in-ear monitoring callback
Param
DESC
enable
true : enable; false (default): disable.

setUserId

setUserId
void setUserId
(String userId)
Set user id
Param
DESC
userId
User/device id maintained by the service side itself.

callExperimentalAPI

callExperimentalAPI
int callExperimentalAPI
(String jsonStr)
Call experimental APIs
Param
DESC
jsonStr
JSON string describing interface and parameters.
Return Desc:
Return code V2TXLiveCode.
V2TXLIVE_OK: successful.
V2TXLIVE_ERROR_INVALID_PARAMETER: operation failed because of illegal parameter.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백