io.agora.rtc

## Class AgoraRtcConn

- java.lang.Object
- - io.agora.rtc.AgoraRtcConn

-     public class AgoraRtcConn
      extends java.lang.Object

  Represents an RTC connection for joining channels and managing media streams.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) class` | `AgoraRtcConn.InternalCapabilitesObserver` Internal capabilities observer implementation.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AgoraParameter` | `agoraParameter` Agora parameter instance
    `private AgoraService` | `agoraService` Agora service instance
    `private AgoraAudioEncodedFrameSender` | `audioEncodedFrameSender` Audio encoded frame sender
    `private AudioFrame` | `audioFrame` Audio frame buffer
    `private AgoraAudioPcmDataSender` | `audioFrameSender` Audio PCM data sender
    `private ICapabilitesObserver` | `capabilitiesObserver` Capabilities observer
    `private long` | `cptr` Native pointer to the RTC connection instance.
    `private AgoraLocalAudioTrack` | `customAudioTrack` Custom audio track
    `private AgoraVideoEncodedImageSender` | `customEncodedImageSender` Custom encoded image sender
    `private AgoraLocalVideoTrack` | `customVideoTrack` Custom video track
    `private int` | `dataStreamId` Data stream ID
    `private boolean` | `isSupportExternalAudio` Whether support external audio
    `private AgoraLocalUser` | `localUser` Local user instance
    `private AgoraMediaNodeFactory` | `mediaNodeFactory` Media node factory for creating media nodes
    `private INetworkObserver` | `networkObserver` Network observer
    `private PcmConsumeStateUtils` | `pcmConsumeStateUtils` PCM consume state utilities
    `private IRtcConnObserver` | `rtcConnObserver` RTC connection observer
    `private RtcConnPublishConfig` | `rtcConnPublishConfig` RTC connection publish configuration
    `private SendExternalAudioParameters` | `sendExternalAudioParameters` For AI scenario send external audio parameters, default to null
    `private AgoraVideoFrameSender` | `videoFrameSender` Video frame sender

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraRtcConn(long cptr)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `adjustLocalAudioTrackPublishVolume(int volume)` Adjusts the publish volume of the local audio track.
    `int` | `connect(java.lang.String token, java.lang.String channelId, java.lang.String userId)` Connects to a channel
    `(package private) int` | `createDataStream(Out<java.lang.Integer> streamId, int reliable, int ordered)` Creates data stream
    `void` | `destroy()` Destroys the RtcConnection instance
    `(package private) void` | `destroyConnInfo(RtcConnInfo info)` Destroys connection information object
    `(package private) void` | `destroyLocalAudioTrackStats(LocalAudioTrackStats stats)` Destroys the provided LocalAudioTrackStats object.
    `(package private) void` | `destroyLocalVideoTrackStatistics(LocalVideoTrackStats stats)` Destroys the provided LocalVideoTrackStats object.
    `(package private) void` | `destroyTransportStats(RtcStats stats)` Destroys transport statistics object
    `(package private) void` | `destroyUserInfo(UserInfo info)` Destroys user information object
    `int` | `disconnect()` Disconnects from current channel
    `int` | `enableEncryption(int enabled, EncryptionConfig config)` Enables/disables encryption
    `int` | `enableLocalAudioTrackEarMonitor(int enable, int includeAudiFilter)` Enables or disables ear monitoring.
    `int` | `enableLocalAudioTrackPlayback(int enable)` Enables or disables local playback of the audio track.
    `int` | `enableSimulcastStream(int enabled, SimulcastStreamConfig config)` Enables or disables the simulcast stream.
    `AgoraParameter` | `getAgoraParameter()` Gets Agora parameter object
    `int` | `getConnId()` Gets connection ID
    `RtcConnInfo` | `getConnInfo()` Gets connection information
    `int` | `getCurrentAudioScenario()` Gets the current audio scenario.
    `int` | `getLocalAudioTrackPublishVolume(Out<java.lang.Integer> volume)` Gets the current publish volume of the local audio track.
    `int` | `getLocalAudioTrackState()` Gets the current state of the local audio track.
    `LocalAudioTrackStats` | `getLocalAudioTrackStats()` Retrieves the statistics of the local audio track.
    `AgoraLocalUser` | `getLocalUser()` Gets local user object
    `int` | `getLocalVideoTrackState()` Gets the current state of the local audio track.
    `LocalVideoTrackStats` | `getLocalVideoTrackStatistics()` Retrieves the statistics of the local video track.
    `RtcStats` | `getTransportStats()` Gets transport statistics
    `UserInfo` | `getUserInfo(java.lang.String userId)` Gets user information by user ID
    `AccountInfo` | `getUserInfoByUid(java.lang.String userId)` Gets user information by UID
    `AccountInfo` | `getUserInfoByUserAccount(java.lang.String userAccount)` Gets user information by user account
    `private void` | `initDataStream()` Initializes the data stream for sending custom messages.
    `(package private) int` | `initRtcConn(AgoraService agoraService, AgoraMediaNodeFactory mediaNodeFactory, RtcConnPublishConfig rtcConnPublishConfig, AgoraServiceConfig agoraServiceConfig)` Initializes the RTC connection.
    `int` | `interruptAudio()` Interrupts the audio track.
    `boolean` | `isPushToRtcCompleted()` Checks if push to RTC is completed.
    `private boolean` | `isSupportExternalAudio(RtcConnPublishConfig publishConfig)` Checks if external audio is supported based on the publish configuration.
    `private int` | `nativeConnect(long cptr, java.lang.String token, java.lang.String channelId, java.lang.String userId)` Connects to a channel natively.
    `private int` | `nativeCreateDataStream(long cptr, Out<java.lang.Integer> streamId, int reliable, int ordered)` Creates a data stream natively.
    `private void` | `nativeDestroy(long cptr)` Releases the native RTC connection handle.
    `private void` | `nativeDestroyConnInfo(long cptr, RtcConnInfo info)` Destroys connection info object natively.
    `private void` | `nativeDestroyTransportStats(long cptr, RtcStats stats)` Destroys transport stats object natively.
    `private void` | `nativeDestroyUserInfo(long cptr, UserInfo info)` Destroys user info object natively.
    `private int` | `nativeDisconnect(long cptr)` Disconnects from the channel natively.
    `private int` | `nativeEnableEncryption(long cptr, int enabled, EncryptionConfig config)` Enables or disables encryption natively.
    `private AgoraParameter` | `nativeGetAgoraParameter(long cptr)` Gets Agora parameter instance natively.
    `private int` | `nativeGetConnId(long cptr)` Gets the connection ID natively.
    `private RtcConnInfo` | `nativeGetConnInfo(long cptr)` Gets connection information natively.
    `private AgoraLocalUser` | `nativeGetLocalUser(long cptr)` Gets the local user instance natively.
    `private RtcStats` | `nativeGetTransportStats(long cptr)` Gets transport statistics natively.
    `private UserInfo` | `nativeGetUserInfo(long cptr, java.lang.String userId)` Gets user information by user ID natively.
    `private AccountInfo` | `nativeGetUserInfoByUid(long cptr, java.lang.String userId)` Gets user information by UID natively.
    `private AccountInfo` | `nativeGetUserInfoByUserAccount(long cptr, java.lang.String userAccount)` Gets user information by user account natively.
    `private int` | `nativeRegisterNetworkObserver(long cptr, INetworkObserver observer)` Registers a network observer natively.
    `private int` | `nativeRegisterObserver(long cptr, IRtcConnObserver observer)` Registers an RTC connection observer natively.
    `private int` | `nativeRenewToken(long cptr, java.lang.String token)` Renews the authentication token natively.
    `private int` | `nativeSendCustomReportMessage(long cptr, java.lang.String id, java.lang.String category, java.lang.String event, java.lang.String label, int value)` Sends a custom report message natively.
    `private int` | `nativeSendStreamMessage(long cptr, int streamId, byte[] messageData)` Sends a stream message natively.
    `private int` | `nativeStartLastmileProbeTest(long cptr, LastmileProbeConfig config)` Starts last mile probe test natively.
    `private int` | `nativeStopLastmileProbeTest(long cptr)` Stops last mile probe test natively.
    `private int` | `nativeUnregisterNetworkObserver(long cptr)` Unregisters the network observer natively.
    `private int` | `nativeUnregisterObserver(long cptr)` Unregisters the RTC connection observer natively.
    `int` | `publishAudio()` Publishes the audio track.
    `int` | `publishVideo()` Publishes the video track.
    `int` | `pushAudioEncodedData(byte[] data, EncodedAudioFrameInfo info)` Pushes audio encoded data.
    `int` | `pushAudioPcmData(byte[] data, int sampleRate, int channels)` Pushes audio PCM data.
    `int` | `pushAudioPcmData(byte[] data, int sampleRate, int channels, long presentationMs)` Pushes audio PCM data.
    `int` | `pushVideoEncodedData(byte[] data, EncodedVideoFrameInfo info)` Pushes video encoded data.
    `int` | `pushVideoFrame(ExternalVideoFrame frame)` Pushes video frame.
    `int` | `registerAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)` Registers an audio encoded frame observer.
    `int` | `registerAudioFrameObserver(IAudioFrameObserver observer, boolean enableVad, AgoraAudioVadConfigV2 vadConfig)` Registers an audio frame observer with VAD (Voice Activity Detection) enabled.
    `int` | `registerLocalUserObserver(ILocalUserObserver observer)` Registers a local user observer.
    `int` | `registerNetworkObserver(INetworkObserver observer)` Registers a network observer
    `int` | `registerObserver(IRtcConnObserver observer)` Registers an RTC connection observer
    `int` | `registerVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)` Registers a video encoded frame observer.
    `int` | `registerVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)` Registers a video frame observer.
    `int` | `renewToken(java.lang.String token)` Renews the token
    `int` | `sendAudioMetaData(byte[] metaData)` Sends audio metadata.
    `int` | `sendCustomReportMessage(java.lang.String id, java.lang.String category, java.lang.String event, java.lang.String label, int value)` Sends custom report message
    `int` | `sendIntraRequest(java.lang.String userId)` Sends an intra request to a specified remote user to request a new key frame.
    `int` | `sendStreamMessage(byte[] messageData)` Sends data stream message
    `private int` | `setExtraSendFrameSpeed(SendExternalAudioParameters sendExternalAudioParameters)` Sets the extra send frame speed for external audio.
    `private int` | `setTotalExtraSendMs()` Sets the total extra send time in milliseconds.
    `int` | `setVideoEncoderConfig(VideoEncoderConfig config)` Sets the video encoder configuration.
    `int` | `startLastmileProbeTest(LastmileProbeConfig config)` Starts last-mile network probe test
    `int` | `stopLastmileProbeTest()` Stops last-mile network probe test
    `int` | `unpublishAudio()` Unpublishes the audio track.
    `int` | `unpublishVideo()` Unpublishes the video track.
    `(package private) int` | `unregisterNetworkObserver()` Unregisters the network observer
    `(package private) int` | `unregisterObserver()` Unregisters the RTC connection observer
    `int` | `updateAudioSenario(int scenario)` Updates the audio scenario.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the RTC connection instance.

    - #### agoraService

          private AgoraService agoraService

      Agora service instance

    - #### mediaNodeFactory

          private AgoraMediaNodeFactory mediaNodeFactory

      Media node factory for creating media nodes

    - #### rtcConnPublishConfig

          private RtcConnPublishConfig rtcConnPublishConfig

      RTC connection publish configuration

    - #### localUser

          private AgoraLocalUser localUser

      Local user instance

    - #### agoraParameter

          private AgoraParameter agoraParameter

      Agora parameter instance

    - #### audioFrameSender

          private volatile AgoraAudioPcmDataSender audioFrameSender

      Audio PCM data sender

    - #### audioEncodedFrameSender

          private volatile AgoraAudioEncodedFrameSender audioEncodedFrameSender

      Audio encoded frame sender

    - #### customAudioTrack

          private volatile AgoraLocalAudioTrack customAudioTrack

      Custom audio track

    - #### videoFrameSender

          private volatile AgoraVideoFrameSender videoFrameSender

      Video frame sender

    - #### customEncodedImageSender

          private volatile AgoraVideoEncodedImageSender customEncodedImageSender

      Custom encoded image sender

    - #### customVideoTrack

          private volatile AgoraLocalVideoTrack customVideoTrack

      Custom video track

    - #### rtcConnObserver

          private IRtcConnObserver rtcConnObserver

      RTC connection observer

    - #### networkObserver

          private INetworkObserver networkObserver

      Network observer

    - #### capabilitiesObserver

          private ICapabilitesObserver capabilitiesObserver

      Capabilities observer

    - #### audioFrame

          private AudioFrame audioFrame

      Audio frame buffer

    - #### dataStreamId

          private int dataStreamId

      Data stream ID

    - #### pcmConsumeStateUtils

          private PcmConsumeStateUtils pcmConsumeStateUtils

      PCM consume state utilities

    - #### isSupportExternalAudio

          private boolean isSupportExternalAudio

      Whether support external audio

    - #### sendExternalAudioParameters

          private SendExternalAudioParameters sendExternalAudioParameters

      For AI scenario send external audio parameters, default to null

  - ### Constructor Detail

    - #### AgoraRtcConn

          AgoraRtcConn(long cptr)

      Constructor
      Parameters:
        `cptr` - Native pointer

  - ### Method Detail

    - #### initRtcConn

          int initRtcConn(AgoraService agoraService,
                          AgoraMediaNodeFactory mediaNodeFactory,
                          RtcConnPublishConfig rtcConnPublishConfig,
                          AgoraServiceConfig agoraServiceConfig)

      Initializes the RTC connection.
      Parameters:
        `agoraService` - The Agora service.
        `mediaNodeFactory` - The media node factory.
        `rtcConnPublishConfig` - The RTC connection publish configuration.
        `agoraServiceConfig` - The Agora service configuration.
      Returns:
        0: Success, < 0: Failure

    - #### initDataStream

          private void initDataStream()

      Initializes the data stream for sending custom messages.

    - #### getCurrentAudioScenario

          public int getCurrentAudioScenario()

      Gets the current audio scenario.
      Returns:
        The current audio scenario.

    - #### destroy

          public void destroy()

      Destroys the RtcConnection instance

    - #### registerObserver

          public int registerObserver(IRtcConnObserver observer)

      Registers an RTC connection observer
      Parameters:
        `observer` - The observer to register
      Returns:
        0: Success, < 0: Failure

    - #### unregisterObserver

          int unregisterObserver()

      Unregisters the RTC connection observer
      Returns:
        0: Success, < 0: Failure

    - #### registerNetworkObserver

          public int registerNetworkObserver(INetworkObserver observer)

      Registers a network observer
      Parameters:
        `observer` - The observer to register
      Returns:
        0: Success, < 0: Failure

    - #### unregisterNetworkObserver

          int unregisterNetworkObserver()

      Unregisters the network observer
      Returns:
        0: Success, < 0: Failure

    - #### registerAudioFrameObserver

          public int registerAudioFrameObserver(IAudioFrameObserver observer,
                                                boolean enableVad,
                                                AgoraAudioVadConfigV2 vadConfig)

      Registers an audio frame observer with VAD (Voice Activity Detection) enabled.
      Parameters:
        `observer` - The audio frame observer to register.
        `enableVad` - Whether to enable VAD.
        `vadConfig` - The VAD configuration.
      Returns:
        0: Success, < 0: Failure

    - #### registerAudioEncodedFrameObserver

          public int registerAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)

      Registers an audio encoded frame observer.
      Parameters:
        `observer` - The audio encoded frame observer to register.
      Returns:
        0: Success, < 0: Failure

    - #### registerLocalUserObserver

          public int registerLocalUserObserver(ILocalUserObserver observer)

      Registers a local user observer.
      Parameters:
        `observer` - The local user observer to register.
      Returns:
        0: Success, < 0: Failure

    - #### registerVideoFrameObserver

          public int registerVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)

      Registers a video frame observer.
      Parameters:
        `agoraVideoFrameObserver2` - The video frame observer to register.
      Returns:
        0: Success, < 0: Failure

    - #### registerVideoEncodedFrameObserver

          public int registerVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)

      Registers a video encoded frame observer.
      Parameters:
        `agoraVideoEncodedFrameObserver` - The video encoded frame observer to register.
      Returns:
        0: Success, < 0: Failure

    - #### publishAudio

          public int publishAudio()

      Publishes the audio track.
      Returns:
        0: Success, < 0: Failure

    - #### unpublishAudio

          public int unpublishAudio()

      Unpublishes the audio track.
      Returns:
        0: Success, < 0: Failure

    - #### publishVideo

          public int publishVideo()

      Publishes the video track.
      Returns:
        0: Success, < 0: Failure

    - #### unpublishVideo

          public int unpublishVideo()

      Unpublishes the video track.
      Returns:
        0: Success, < 0: Failure

    - #### interruptAudio

          public int interruptAudio()

      Interrupts the audio track.
      Returns:
        0: Success, < 0: Failure

    - #### pushAudioPcmData

          public int pushAudioPcmData(byte[] data,
                                      int sampleRate,
                                      int channels,
                                      long presentationMs)

      Pushes audio PCM data.
      Parameters:
        `data` - The audio data.
        `sampleRate` - The sample rate.
        `channels` - The number of channels.
        `presentationMs` - The presentation timestamp.and it can pass to onPlaybackBeforeMixing's audioframe.presentationMs
      Returns:
        0: Success, < 0: Failure

    - #### pushAudioPcmData

          public int pushAudioPcmData(byte[] data,
                                      int sampleRate,
                                      int channels)

      Pushes audio PCM data.
      Parameters:
        `data` - The audio data.
        `sampleRate` - The sample rate.
        `channels` - The number of channels.
      Returns:
        0: Success, < 0: Failure

    - #### pushAudioEncodedData

          public int pushAudioEncodedData(byte[] data,
                                          EncodedAudioFrameInfo info)

      Pushes audio encoded data.
      Parameters:
        `data` - The audio data.
        `info` - The audio frame info.
      Returns:
        0: Success, < 0: Failure

    - #### pushVideoFrame

          public int pushVideoFrame(ExternalVideoFrame frame)

      Pushes video frame.
      Parameters:
        `frame` - The video frame.
      Returns:
        0: Success, < 0: Failure

    - #### pushVideoEncodedData

          public int pushVideoEncodedData(byte[] data,
                                          EncodedVideoFrameInfo info)

      Pushes video encoded data.
      Parameters:
        `data` - The video data.
        `info` - The video frame info.
      Returns:
        0: Success, < 0: Failure

    - #### updateAudioSenario

          public int updateAudioSenario(int scenario)

      Updates the audio scenario.
      Parameters:
        `scenario` - The audio scenario.
      Returns:
        0: Success, < 0: Failure

    - #### sendStreamMessage

          public int sendStreamMessage(byte[] messageData)

      Sends data stream message
      Parameters:
        `messageData` - Message content in bytes
      Returns:
        0: Success, < 0: Failure

    - #### connect

          public int connect(java.lang.String token,
                             java.lang.String channelId,
                             java.lang.String userId)

      Connects to a channel
      Parameters:
        `token` - Authentication token
        `channelId` - Channel ID to join
        `userId` - User ID
      Returns:
        0: Success, < 0: Failure

    - #### disconnect

          public int disconnect()

      Disconnects from current channel
      Returns:
        0: Success, < 0: Failure

    - #### startLastmileProbeTest

          public int startLastmileProbeTest(LastmileProbeConfig config)

      Starts last-mile network probe test
      Parameters:
        `config` - Configuration for the probe test
      Returns:
        0: Success, < 0: Failure

    - #### stopLastmileProbeTest

          public int stopLastmileProbeTest()

      Stops last-mile network probe test
      Returns:
        0: Success, < 0: Failure

    - #### renewToken

          public int renewToken(java.lang.String token)

      Renews the token
      Parameters:
        `token` - New token to use
      Returns:
        0: Success, < 0: Failure

    - #### getConnInfo

          public RtcConnInfo getConnInfo()

      Gets connection information
      Returns:
        RtcConnInfo object containing connection details

    - #### destroyConnInfo

          void destroyConnInfo(RtcConnInfo info)

      Destroys connection information object
      Parameters:
        `info` - RtcConnInfo object to destroy

    - #### getLocalUser

          public AgoraLocalUser getLocalUser()

      Gets local user object
      Returns:
        AgoraLocalUser object

    - #### getUserInfo

          public UserInfo getUserInfo(java.lang.String userId)

      Gets user information by user ID
      Parameters:
        `userId` - User ID to query
      Returns:
        UserInfo object containing user details

    - #### getUserInfoByUserAccount

          public AccountInfo getUserInfoByUserAccount(java.lang.String userAccount)

      Gets user information by user account
      Parameters:
        `userAccount` - User account to query
      Returns:
        AccountInfo object containing user details

    - #### getUserInfoByUid

          public AccountInfo getUserInfoByUid(java.lang.String userId)

      Gets user information by UID
      Parameters:
        `userId` - User ID to query
      Returns:
        AccountInfo object containing user details

    - #### destroyUserInfo

          void destroyUserInfo(UserInfo info)

      Destroys user information object
      Parameters:
        `info` - UserInfo object to destroy

    - #### getConnId

          public int getConnId()

      Gets connection ID
      Returns:
        Connection ID

    - #### getTransportStats

          public RtcStats getTransportStats()

      Gets transport statistics
      Returns:
        RtcStats object containing transport statistics

    - #### destroyTransportStats

          void destroyTransportStats(RtcStats stats)

      Destroys transport statistics object
      Parameters:
        `stats` - RtcStats object to destroy

    - #### getAgoraParameter

          public AgoraParameter getAgoraParameter()

      Gets Agora parameter object
      Returns:
        AgoraParameter object

    - #### createDataStream

          int createDataStream(Out<java.lang.Integer> streamId,
                               int reliable,
                               int ordered)

      Creates data stream
      Parameters:
        `streamId` - Output parameter to receive stream ID
        `reliable` - Whether the stream is reliable
        `ordered` - Whether the stream is ordered
      Returns:
        0: Success, < 0: Failure

    - #### enableEncryption

          public int enableEncryption(int enabled,
                                      EncryptionConfig config)

      Enables/disables encryption
      Parameters:
        `enabled` - Whether to enable encryption (1: Enable, 0: Disable)
        `config` - Encryption configuration
      Returns:
        0: Success, < 0: Failure

    - #### sendCustomReportMessage

          public int sendCustomReportMessage(java.lang.String id,
                                             java.lang.String category,
                                             java.lang.String event,
                                             java.lang.String label,
                                             int value)

      Sends custom report message
      Parameters:
        `id` - Report ID
        `category` - Report category
        `event` - Report event
        `label` - Report label
        `value` - Report value
      Returns:
        0: Success, < 0: Failure

    - #### setVideoEncoderConfig

          public int setVideoEncoderConfig(VideoEncoderConfig config)

      Sets the video encoder configuration.
      Parameters:
        `config` - The video encoder configuration to set.
      Returns:
        0 on success, <0 on failure.

    - #### enableSimulcastStream

          public int enableSimulcastStream(int enabled,
                                           SimulcastStreamConfig config)

      Enables or disables the simulcast stream.
      Parameters:
        `enabled` - 1 to enable, 0 to disable.
        `config` - The simulcast stream configuration.
      Returns:
        0 on success, <0 on failure.

    - #### getLocalVideoTrackState

          public int getLocalVideoTrackState()

      Gets the current state of the local audio track.
      Returns:
        The state of the audio track.

    - #### getLocalVideoTrackStatistics

          public LocalVideoTrackStats getLocalVideoTrackStatistics()

      Retrieves the statistics of the local video track.
      Returns:
        An instance of LocalVideoTrackStats containing the statistics.

    - #### destroyLocalVideoTrackStatistics

          void destroyLocalVideoTrackStatistics(LocalVideoTrackStats stats)

      Destroys the provided LocalVideoTrackStats object.
      Parameters:
        `stats` - The LocalVideoTrackStats object to be destroyed.

    - #### getLocalAudioTrackState

          public int getLocalAudioTrackState()

      Gets the current state of the local audio track.
      Returns:
        The state of the audio track.

    - #### getLocalAudioTrackStats

          public LocalAudioTrackStats getLocalAudioTrackStats()

      Retrieves the statistics of the local audio track.
      Returns:
        An instance of LocalAudioTrackStats containing the statistics.

    - #### destroyLocalAudioTrackStats

          void destroyLocalAudioTrackStats(LocalAudioTrackStats stats)

      Destroys the provided LocalAudioTrackStats object.
      Parameters:
        `stats` - The LocalAudioTrackStats object to be destroyed.

    - #### adjustLocalAudioTrackPublishVolume

          public int adjustLocalAudioTrackPublishVolume(int volume)

      Adjusts the publish volume of the local audio track.
      Parameters:
        `volume` - The volume level to set.
      Returns:
        0 on success, <0 on failure.

    - #### getLocalAudioTrackPublishVolume

          public int getLocalAudioTrackPublishVolume(Out<java.lang.Integer> volume)

      Gets the current publish volume of the local audio track.
      Parameters:
        `volume` - An Out object to store the volume level.
      Returns:
        0 on success, <0 on failure.

    - #### enableLocalAudioTrackPlayback

          public int enableLocalAudioTrackPlayback(int enable)

      Enables or disables local playback of the audio track.
      Parameters:
        `enable` - 1 to enable, 0 to disable.
      Returns:
        0 on success, <0 on failure.

    - #### enableLocalAudioTrackEarMonitor

          public int enableLocalAudioTrackEarMonitor(int enable,
                                                     int includeAudiFilter)

      Enables or disables ear monitoring.
      Parameters:
        `enable` - 1 to enable, 0 to disable.
        `includeAudiFilter` - 1 to include audio filter, 0 to exclude.
      Returns:
        0 on success, <0 on failure.

    - #### sendAudioMetaData

          public int sendAudioMetaData(byte[] metaData)

      Sends audio metadata.
      Parameters:
        `metaData` - The audio metadata to send.
      Returns:
        0: Success, < 0: Failure

    - #### isPushToRtcCompleted

          public boolean isPushToRtcCompleted()

      Checks if push to RTC is completed.
      Returns:
        true if push is completed, false otherwise

    - #### sendIntraRequest

          public int sendIntraRequest(java.lang.String userId)

      Sends an intra request to a specified remote user to request a new key frame. This method requests the remote user to generate and send a new key frame (I-frame) for video streaming. This is useful when the local user experiences video decoding issues or needs to recover from packet loss. Limitations: - If the remote user is using fixed-interval key frame encoding, this API call will be ignored. - The minimum frequency of this API call is 1 second. Calls made more frequently will be ignored, or the VOS (Video Optimization Service) will perform convergence.
      Parameters:
        `userId` - The user ID of the remote user to send the intra request to.
      Returns:
        `0` if the request is sent successfully; `< 0` if the request fails. See `Constants.ErrorCodeType` for details.

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

      Releases the native RTC connection handle.
      Parameters:
        `cptr` - Native pointer to the RTC connection

    - #### nativeRegisterObserver

          private int nativeRegisterObserver(long cptr,
                                             IRtcConnObserver observer)

      Registers an RTC connection observer natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `observer` - RTC connection observer instance
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterObserver

          private int nativeUnregisterObserver(long cptr)

      Unregisters the RTC connection observer natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterNetworkObserver

          private int nativeRegisterNetworkObserver(long cptr,
                                                    INetworkObserver observer)

      Registers a network observer natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `observer` - Network observer instance
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterNetworkObserver

          private int nativeUnregisterNetworkObserver(long cptr)

      Unregisters the network observer natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        0 on success, <0 on failure

    - #### nativeSendStreamMessage

          private int nativeSendStreamMessage(long cptr,
                                              int streamId,
                                              byte[] messageData)

      Sends a stream message natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `streamId` - Stream ID
        `messageData` - Message data to send
      Returns:
        0 on success, <0 on failure

    - #### nativeConnect

          private int nativeConnect(long cptr,
                                    java.lang.String token,
                                    java.lang.String channelId,
                                    java.lang.String userId)

      Connects to a channel natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `token` - Authentication token
        `channelId` - Channel ID
        `userId` - User ID
      Returns:
        0 on success, <0 on failure

    - #### nativeDisconnect

          private int nativeDisconnect(long cptr)

      Disconnects from the channel natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        0 on success, <0 on failure

    - #### nativeStartLastmileProbeTest

          private int nativeStartLastmileProbeTest(long cptr,
                                                   LastmileProbeConfig config)

      Starts last mile probe test natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `config` - Last mile probe configuration
      Returns:
        0 on success, <0 on failure

    - #### nativeStopLastmileProbeTest

          private int nativeStopLastmileProbeTest(long cptr)

      Stops last mile probe test natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        0 on success, <0 on failure

    - #### nativeRenewToken

          private int nativeRenewToken(long cptr,
                                       java.lang.String token)

      Renews the authentication token natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `token` - New authentication token
      Returns:
        0 on success, <0 on failure

    - #### nativeGetConnInfo

          private RtcConnInfo nativeGetConnInfo(long cptr)

      Gets connection information natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        Connection information

    - #### nativeDestroyConnInfo

          private void nativeDestroyConnInfo(long cptr,
                                             RtcConnInfo info)

      Destroys connection info object natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `info` - Connection info object to destroy

    - #### nativeGetLocalUser

          private AgoraLocalUser nativeGetLocalUser(long cptr)

      Gets the local user instance natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        Local user instance

    - #### nativeGetUserInfo

          private UserInfo nativeGetUserInfo(long cptr,
                                             java.lang.String userId)

      Gets user information by user ID natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `userId` - User ID
      Returns:
        User information

    - #### nativeGetUserInfoByUserAccount

          private AccountInfo nativeGetUserInfoByUserAccount(long cptr,
                                                             java.lang.String userAccount)

      Gets user information by user account natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `userAccount` - User account
      Returns:
        Account information

    - #### nativeGetUserInfoByUid

          private AccountInfo nativeGetUserInfoByUid(long cptr,
                                                     java.lang.String userId)

      Gets user information by UID natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `userId` - User ID
      Returns:
        Account information

    - #### nativeDestroyUserInfo

          private void nativeDestroyUserInfo(long cptr,
                                             UserInfo info)

      Destroys user info object natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `info` - User info object to destroy

    - #### nativeGetConnId

          private int nativeGetConnId(long cptr)

      Gets the connection ID natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        Connection ID

    - #### nativeGetTransportStats

          private RtcStats nativeGetTransportStats(long cptr)

      Gets transport statistics natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        Transport statistics

    - #### nativeDestroyTransportStats

          private void nativeDestroyTransportStats(long cptr,
                                                   RtcStats stats)

      Destroys transport stats object natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `stats` - Transport stats object to destroy

    - #### nativeGetAgoraParameter

          private AgoraParameter nativeGetAgoraParameter(long cptr)

      Gets Agora parameter instance natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
      Returns:
        Agora parameter instance

    - #### nativeCreateDataStream

          private int nativeCreateDataStream(long cptr,
                                             Out<java.lang.Integer> streamId,
                                             int reliable,
                                             int ordered)

      Creates a data stream natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `streamId` - Output stream ID
        `reliable` - Whether the stream is reliable
        `ordered` - Whether the stream is ordered
      Returns:
        0 on success, <0 on failure

    - #### nativeEnableEncryption

          private int nativeEnableEncryption(long cptr,
                                             int enabled,
                                             EncryptionConfig config)

      Enables or disables encryption natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `enabled` - 1 to enable, 0 to disable
        `config` - Encryption configuration
      Returns:
        0 on success, <0 on failure

    - #### nativeSendCustomReportMessage

          private int nativeSendCustomReportMessage(long cptr,
                                                    java.lang.String id,
                                                    java.lang.String category,
                                                    java.lang.String event,
                                                    java.lang.String label,
                                                    int value)

      Sends a custom report message natively.
      Parameters:
        `cptr` - Native pointer to the RTC connection
        `id` - Message ID
        `category` - Message category
        `event` - Event name
        `label` - Label
        `value` - Value
      Returns:
        0 on success, <0 on failure

    - #### isSupportExternalAudio

          private boolean isSupportExternalAudio(RtcConnPublishConfig publishConfig)

      Checks if external audio is supported based on the publish configuration.
      Parameters:
        `publishConfig` - The publish configuration
      Returns:
        true if external audio is supported, false otherwise

    - #### setExtraSendFrameSpeed

          private int setExtraSendFrameSpeed(SendExternalAudioParameters sendExternalAudioParameters)

      Sets the extra send frame speed for external audio. Should be called before the connection is connected.
      Parameters:
        `sendExternalAudioParameters` - The send external audio parameters
      Returns:
        0 on success, <0 on failure

    - #### setTotalExtraSendMs

          private int setTotalExtraSendMs()

      Sets the total extra send time in milliseconds. Note: For internal call only, should be called after checking isSupportExternalAudio.
      Returns:
        0 on success, <0 on failure