tencent cloud

Feedback

V2TXLivePremier

Last updated: 2024-01-16 17:57:14
    Copyright (c) 2021 Tencent. All rights reserved.
    
    Module: V2TXLivePremier @ TXLiteAVSDK
    
    Function: V2TXLive High-level interface
    
    V2TXLivePremier

    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

    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

    getSDKVersionStr

    getSDKVersionStr

    Get the SDK version number

    setObserver:

    setObserver:
    + (void)setObserver:
    (id<V2TXLivePremierObserver>)observer

    Set V2TXLivePremier callback interface

    setLogConfig:

    setLogConfig:
    + (V2TXLiveCode)setLogConfig:
    (V2TXLiveLogConfig *)config

    Set Log configuration information

    setEnvironment:

    setEnvironment:
    + (V2TXLiveCode)setEnvironment:
    (const char *)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:key:

    setLicence:key:
    + (void)setLicence:
    (NSString *)url
    key:
    (NSString *)key

    Set SDK authorization license

    
    Try and Purchase a License: https://www.tencentcloud.com/document/product/1071/38546.
    Param
    DESC
    key
    the key of licence.
    url
    the url of licence.

    setSocks5Proxy:port:username:password:config:

    setSocks5Proxy:port:username:password:config:
    + (V2TXLiveCode)setSocks5Proxy:
    (NSString *)host
    port:
    (NSInteger)port
    username:
    (NSString *)username
    password:
    (NSString *)password
    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:format:

    enableAudioCaptureObserver:format:
    + (V2TXLiveCode)enableAudioCaptureObserver:
    (BOOL)enable
    format:

    Enables/Disables audio capture callback

    Param
    DESC
    enable
    YES : enable; NO (default): disable.
    format
    audio frame format.
    Note
    This API works only if you call it before startPush.

    enableAudioPlayoutObserver:format:

    enableAudioPlayoutObserver:format:
    + (V2TXLiveCode)enableAudioPlayoutObserver:
    (BOOL)enable
    format:

    Enables/Disables audio playout callback

    Param
    DESC
    enable
    YES : enable; NO (default): disable.
    format
    audio frame format.

    enableVoiceEarMonitorObserver:

    enableVoiceEarMonitorObserver:
    + (V2TXLiveCode)enableVoiceEarMonitorObserver:
    (BOOL)enable

    Enables/Disables in-ear monitoring callback

    Param
    DESC
    enable
    YES : enable; NO (default): disable.

    setUserId:

    setUserId:
    + (void)setUserId:
    (NSString *)userId

    Set user id

    Param
    DESC
    userId
    User/device id maintained by the service side itself.

    callExperimentalAPI:

    callExperimentalAPI:
    + (V2TXLiveCode)callExperimentalAPI:
    (NSString *)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.

    onLog:log:

    onLog:log:
    - (void)onLog:
    (V2TXLiveLogLevel)level
    log:
    (NSString *)log

    Custom Log output callback interface

    onLicenceLoaded:Reason:

    onLicenceLoaded:Reason:
    - (void)onLicenceLoaded:
    (int)result
    Reason:
    (NSString *)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:
    (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:
    (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:
    (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.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support