io.agora.rtc

## Class AgoraLocalUser

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

-     public class AgoraLocalUser
      extends java.lang.Object

  Manages observers and publication state for a local user instance.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AgoraAudioFrameObserverWrapper` | `agoraAudioFrameObserver` Cached audio frame observer wrapper.
    `private AgoraServiceConfig` | `agoraServiceConfig` Configuration used when registering observers.
    `private AgoraVideoEncodedFrameObserver` | `agoraVideoEncodedFrameObserver` Cached video encoded frame observer.
    `private AgoraVideoFrameObserver2` | `agoraVideoFrameObserver2` Cached video frame observer.
    `private IAudioEncodedFrameObserver` | `audioEncodedFrameObserver` Cached audio encoded frame observer.
    `private ICapabilitesObserver` | `capabilitesObserver` Cached capabilities observer.
    `private long` | `cptr` Native pointer backing this local user.
    `private java.util.concurrent.atomic.AtomicBoolean` | `isPublishedAudio` Tracks whether audio has been published.
    `private java.util.concurrent.atomic.AtomicBoolean` | `isPublishedVideo` Tracks whether video has been published.
    `private ILocalUserObserver` | `localUserObserver` Registered local user observer.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraLocalUser(long cptr)` Creates a local user wrapper.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `adjustPlaybackSignalVolume(int volume)` Adjusts the playback signal volume.
    `(package private) void` | `destroy()` Destroys the AgoraLocalUser instance and unregisters all observers.
    `(package private) void` | `destroyLocalAudioStatistics(LocalAudioDetailedStats stats)` Destroys the local audio statistics.
    `LocalAudioDetailedStats` | `getLocalAudioStatistics()` Gets the local audio statistics.
    `AgoraMediaCtrlPacketSender` | `getMediaControlPacketSender()` Gets the media control packet sender.
    `int` | `getPlaybackSignalVolume(Out<java.lang.Integer> volume)` Gets the playback signal volume.
    `int` | `getUserRole()` Gets the user role.
    `private int` | `nativeAdjustPlaybackSignalVolume(long cptr, int volume)` Adjusts playback signal volume via the native API.
    `private int` | `nativeDestroy(long cptr)` Destroys the native local user instance.
    `private void` | `nativeDestroyLocalAudioStatistics(long cptr, LocalAudioDetailedStats stats)` Releases local audio statistics objects.
    `private LocalAudioDetailedStats` | `nativeGetLocalAudioStatistics(long cptr)` Retrieves local audio statistics from the native engine.
    `private AgoraMediaCtrlPacketSender` | `nativeGetMediaControlPacketSender(long cptr)` Retrieves the media control packet sender from the native engine.
    `private int` | `nativeGetPlaybackSignalVolume(long cptr, Out<java.lang.Integer> volume)` Retrieves playback signal volume from the native layer.
    `private int` | `nativeGetUserRole(long cptr)` Gets the user role from the native layer.
    `private int` | `nativePublishAudio(long cptr, AgoraLocalAudioTrack agoraLocalAudioTrack)` Publishes a local audio track natively.
    `private int` | `nativePublishVideo(long cptr, AgoraLocalVideoTrack agoraLocalVideoTrack)` Publishes a local video track natively.
    `private int` | `nativeRegisterAudioEncodedFrameObserver(long cptr, IAudioEncodedFrameObserver observer)` Registers an audio encoded frame observer natively.
    `private int` | `nativeRegisterAudioFrameObserver(long cptr, AgoraAudioFrameObserverWrapper observer)` Registers an audio frame observer with the native SDK.
    `private int` | `nativeRegisterCapabilitesObserver(long cptr, ICapabilitesObserver observer)` Registers a capabilities observer with the native engine.
    `private int` | `nativeRegisterMediaControlPacketReceiver(long cptr, AgoraMediaPacketReceiver agoraMediaPacketReceiver)` Registers a media control packet receiver natively.
    `private int` | `nativeRegisterObserver(long cptr, ILocalUserObserver observer)` Registers a local user observer with the native engine.
    `private int` | `nativeRegisterVideoEncodedFrameObserver(long cptr, AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)` Registers a video encoded frame observer natively.
    `private int` | `nativeRegisterVideoFrameObserver(long cptr, AgoraVideoFrameObserver2 agoraVideoFrameObserver2)` Registers a video frame observer with the native engine.
    `private int` | `nativeSendAudioMetaData(long cptr, byte[] metaData)` Sends audio metadata through the native API.
    `private int` | `nativeSendIntraRequest(long cptr, java.lang.String userId)` Sends an intra request via the native layer.
    `private int` | `nativeSetAudioEncoderConfig(long cptr, AudioEncoderConfig config)` Applies the audio encoder configuration natively.
    `private int` | `nativeSetAudioScenario(long cptr, int scenarioType)` Sets the audio scenario through the native API.
    `private int` | `nativeSetAudioVolumeIndicationParameters(long cptr, int intervalInMs, int smooth, boolean reportVad)` Configures audio volume indication parameters in the native layer.
    `private int` | `nativeSetMixedAudioFrameParameters(long cptr, int channels, int sampleRateHz, int samplesPerCall)` Sets mixed audio frame parameters on the native engine.
    `private int` | `nativeSetPlaybackAudioFrameBeforeMixingParameters(long cptr, int channels, int sampleRateHz)` Sets playback-before-mixing parameters natively.
    `private int` | `nativeSetPlaybackAudioFrameParameters(long cptr, int channels, int sampleRateHz, int mode, int samplesPerCall)` Sets playback audio frame parameters on the native engine.
    `private int` | `nativeSetRecordingAudioFrameParameters(long cptr, int channels, int sampleRateHz, int mode, int samplesPerCall)` Sets recording audio frame parameters on the native engine.
    `private int` | `nativeSetUserRole(long cptr, int role)` Sets the user role through the native API.
    `private int` | `nativeSubscribeAllAudio(long cptr)` Subscribes to all remote audio streams natively.
    `private int` | `nativeSubscribeAllVideo(long cptr, VideoSubscriptionOptions options)` Subscribes to all video streams via the native engine.
    `private int` | `nativeSubscribeAudio(long cptr, java.lang.String userId)` Subscribes to a remote user's audio stream natively.
    `private int` | `nativeSubscribeVideo(long cptr, java.lang.String userId, VideoSubscriptionOptions options)` Subscribes to a user's video stream via the native engine.
    `private int` | `nativeUnpublishAudio(long cptr, AgoraLocalAudioTrack agoraLocalAudioTrack)` Unpublishes a local audio track natively.
    `private int` | `nativeUnpublishVideo(long cptr, AgoraLocalVideoTrack agoraLocalVideoTrack)` Unpublishes a local video track natively.
    `private int` | `nativeUnregisterAudioEncodedFrameObserver(long cptr, IAudioEncodedFrameObserver observer)` Unregisters an audio encoded frame observer natively.
    `private int` | `nativeUnregisterAudioFrameObserver(long cptr)` Unregisters the audio frame observer at the native layer.
    `private int` | `nativeUnregisterCapabilitesObserver(long cptr, ICapabilitesObserver observer)` Unregisters a capabilities observer natively.
    `private int` | `nativeUnregisterMediaControlPacketReceiver(long cptr, AgoraMediaPacketReceiver agoraMediaPacketReceiver)` Unregisters a media control packet receiver natively.
    `private int` | `nativeUnregisterObserver(long cptr)` Unregisters the local user observer natively.
    `private int` | `nativeUnregisterVideoEncodedFrameObserver(long cptr, AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)` Unregisters a video encoded frame observer natively.
    `private int` | `nativeUnregisterVideoFrameObserver(long cptr, AgoraVideoFrameObserver2 agoraVideoFrameObserver2)` Unregisters a video frame observer at the native layer.
    `private int` | `nativeUnsubscribeAllAudio(long cptr)` Unsubscribes from all remote audio streams natively.
    `private int` | `nativeUnsubscribeAllVideo(long cptr)` Unsubscribes from all video streams natively.
    `private int` | `nativeUnsubscribeAudio(long cptr, java.lang.String userId)` Unsubscribes from a remote user's audio stream natively.
    `private int` | `nativeUnsubscribeVideo(long cptr, java.lang.String userId)` Unsubscribes from a user's video stream natively.
    `int` | `publishAudio(AgoraLocalAudioTrack agoraLocalAudioTrack)` Publishes the local audio track.
    `int` | `publishVideo(AgoraLocalVideoTrack agoraLocalVideoTrack)` Publishes the local video track.
    `(package private) int` | `registerAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)` Registers an audio encoded frame observer.
    `(package private) int` | `registerAudioFrameObserver(IAudioFrameObserver observer)` Registers an audio frame observer.
    `(package private) int` | `registerAudioFrameObserver(IAudioFrameObserver observer, boolean enableVad, AgoraAudioVadConfigV2 vadConfig)` Registers an audio frame observer with VAD (Voice Activity Detection) enabled.
    `(package private) int` | `registerCapabilitesObserver(ICapabilitesObserver observer)` Registers a capabilities observer.
    `int` | `registerMediaControlPacketReceiver(AgoraMediaPacketReceiver agoraMediaPacketReceiver)` Registers a media control packet receiver.
    `(package private) int` | `registerObserver(ILocalUserObserver observer)` Registers a local user observer.
    `(package private) int` | `registerVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)` Registers a video encoded frame observer.
    `(package private) int` | `registerVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)` Registers a video frame observer.
    `(package private) int` | `sendAudioMetaData(byte[] metaData)` Sends audio metadata.
    `(package private) int` | `sendIntraRequest(java.lang.String userId)` Sends an intra request to a specified user.
    `(package private) void` | `setAgoraServiceConfig(AgoraServiceConfig agoraServiceConfig)` Injects the service configuration used for observer registration.
    `int` | `setAudioEncoderConfig(AudioEncoderConfig config)` Sets the audio encoder configuration.
    `int` | `setAudioScenario(int scenarioType)` Sets the audio scenario.
    `int` | `setAudioVolumeIndicationParameters(int intervalInMs, int smooth, boolean reportVad)` Sets the audio volume indication parameters.
    `int` | `setMixedAudioFrameParameters(int channels, int sampleRateHz, int samplesPerCall)` Sets the mixed audio frame parameters.
    `int` | `setPlaybackAudioFrameBeforeMixingParameters(int channels, int sampleRateHz)` Sets the playback audio frame parameters before mixing.
    `int` | `setPlaybackAudioFrameParameters(int channels, int sampleRateHz, int mode, int samplesPerCall)` Sets the playback audio frame parameters.
    `int` | `setRecordingAudioFrameParameters(int channels, int sampleRateHz, int mode, int samplesPerCall)` Sets the recording audio frame parameters.
    `void` | `setUserRole(int role)` Sets the user role.
    `int` | `subscribeAllAudio()` Subscribes to the audio of all users.
    `int` | `subscribeAllVideo(VideoSubscriptionOptions options)` Subscribes to the video of all users.
    `int` | `subscribeAudio(java.lang.String userId)` Subscribes to the audio of a specified user.
    `int` | `subscribeVideo(java.lang.String userId, VideoSubscriptionOptions options)` Subscribes to the video of a specified user.
    `int` | `unpublishAudio(AgoraLocalAudioTrack agoraLocalAudioTrack)` Unpublishes the local audio track.
    `int` | `unpublishVideo(AgoraLocalVideoTrack agoraLocalVideoTrack)` Unpublishes the local video track.
    `(package private) int` | `unregisterAllObservers()` Unregisters all observers.
    `(package private) int` | `unregisterAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)` Unregisters the audio encoded frame observer.
    `(package private) int` | `unregisterAudioFrameObserver()` Unregisters the audio frame observer.
    `(package private) int` | `unregisterCapabilitesObserver(ICapabilitesObserver observer)` Unregisters a capabilities observer.
    `int` | `unregisterMediaControlPacketReceiver(AgoraMediaPacketReceiver agoraMediaPacketReceiver)` Unregisters the media control packet receiver.
    `(package private) int` | `unregisterObserver()` Unregisters the local user observer.
    `(package private) int` | `unregisterVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)` Unregisters the video encoded frame observer.
    `(package private) int` | `unregisterVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)` Unregisters the video frame observer.
    `int` | `unsubscribeAllAudio()` Unsubscribes from the audio of all users.
    `int` | `unsubscribeAllVideo()` Unsubscribes from the video of all users.
    `int` | `unsubscribeAudio(java.lang.String userId)` Unsubscribes from the audio of a specified user.
    `int` | `unsubscribeVideo(java.lang.String userId)` Unsubscribes from the video of a specified user.

    - ### 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 backing this local user.

    - #### agoraAudioFrameObserver

          private AgoraAudioFrameObserverWrapper agoraAudioFrameObserver

      Cached audio frame observer wrapper.

    - #### audioEncodedFrameObserver

          private IAudioEncodedFrameObserver audioEncodedFrameObserver

      Cached audio encoded frame observer.

    - #### agoraVideoFrameObserver2

          private AgoraVideoFrameObserver2 agoraVideoFrameObserver2

      Cached video frame observer.

    - #### agoraVideoEncodedFrameObserver

          private AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver

      Cached video encoded frame observer.

    - #### capabilitesObserver

          private ICapabilitesObserver capabilitesObserver

      Cached capabilities observer.

    - #### localUserObserver

          private volatile ILocalUserObserver localUserObserver

      Registered local user observer.

    - #### isPublishedAudio

          private final java.util.concurrent.atomic.AtomicBoolean isPublishedAudio

      Tracks whether audio has been published.

    - #### isPublishedVideo

          private final java.util.concurrent.atomic.AtomicBoolean isPublishedVideo

      Tracks whether video has been published.

    - #### agoraServiceConfig

          private AgoraServiceConfig agoraServiceConfig

      Configuration used when registering observers.

  - ### Constructor Detail

    - #### AgoraLocalUser

          AgoraLocalUser(long cptr)

      Creates a local user wrapper.
      Parameters:
        `cptr` - Native pointer

  - ### Method Detail

    - #### setAgoraServiceConfig

          void setAgoraServiceConfig(AgoraServiceConfig agoraServiceConfig)

      Injects the service configuration used for observer registration.
      Parameters:
        `agoraServiceConfig` - Service configuration

    - #### unregisterAllObservers

          int unregisterAllObservers()

      Unregisters all observers.
      Returns:
        0: Success, < 0: Failure

    - #### destroy

          void destroy()

      Destroys the AgoraLocalUser instance and unregisters all observers.

    - #### registerAudioFrameObserver

          int registerAudioFrameObserver(IAudioFrameObserver observer)

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

    - #### registerAudioFrameObserver

          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

    - #### unregisterAudioFrameObserver

          int unregisterAudioFrameObserver()

      Unregisters the audio frame observer.
      Returns:
        0: Success, < 0: Failure

    - #### registerAudioEncodedFrameObserver

          int registerAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)

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

    - #### unregisterAudioEncodedFrameObserver

          int unregisterAudioEncodedFrameObserver(IAudioEncodedFrameObserver observer)

      Unregisters the audio encoded frame observer.
      Parameters:
        `observer` - The audio encoded frame observer to unregister.
      Returns:
        0: Success, < 0: Failure

    - #### registerObserver

          int registerObserver(ILocalUserObserver observer)

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

    - #### unregisterObserver

          int unregisterObserver()

      Unregisters the local user observer.
      Returns:
        0: Success, < 0: Failure

    - #### registerVideoFrameObserver

          int registerVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)

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

    - #### unregisterVideoFrameObserver

          int unregisterVideoFrameObserver(AgoraVideoFrameObserver2 agoraVideoFrameObserver2)

      Unregisters the video frame observer.
      Parameters:
        `agoraVideoFrameObserver2` - The video frame observer to unregister.
      Returns:
        0: Success, < 0: Failure

    - #### registerVideoEncodedFrameObserver

          int registerVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)

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

    - #### unregisterVideoEncodedFrameObserver

          int unregisterVideoEncodedFrameObserver(AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)

      Unregisters the video encoded frame observer.
      Parameters:
        `agoraVideoEncodedFrameObserver` - The video encoded frame observer to unregister.
      Returns:
        0: Success, < 0: Failure

    - #### registerCapabilitesObserver

          int registerCapabilitesObserver(ICapabilitesObserver observer)

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

    - #### unregisterCapabilitesObserver

          int unregisterCapabilitesObserver(ICapabilitesObserver observer)

      Unregisters a capabilities observer.
      Parameters:
        `observer` - The capabilities observer to unregister.
      Returns:
        0: Success, < 0: Failure

    - #### setUserRole

          public void setUserRole(int role)

      Sets the user role.
      Parameters:
        `role` - The user role to set.

    - #### getUserRole

          public int getUserRole()

      Gets the user role.
      Returns:
        The user role.

    - #### setAudioEncoderConfig

          public int setAudioEncoderConfig(AudioEncoderConfig config)

      Sets the audio encoder configuration.
      Parameters:
        `config` - The audio encoder configuration to set.
      Returns:
        0: Success, < 0: Failure

    - #### getLocalAudioStatistics

          public LocalAudioDetailedStats getLocalAudioStatistics()

      Gets the local audio statistics.
      Returns:
        The local audio statistics.

    - #### destroyLocalAudioStatistics

          void destroyLocalAudioStatistics(LocalAudioDetailedStats stats)

      Destroys the local audio statistics.
      Parameters:
        `stats` - The local audio statistics to destroy.

    - #### publishAudio

          public int publishAudio(AgoraLocalAudioTrack agoraLocalAudioTrack)

      Publishes the local audio track.
      Parameters:
        `agoraLocalAudioTrack` - The local audio track to publish.
      Returns:
        0: Success, < 0: Failure

    - #### unpublishAudio

          public int unpublishAudio(AgoraLocalAudioTrack agoraLocalAudioTrack)

      Unpublishes the local audio track.
      Parameters:
        `agoraLocalAudioTrack` - The local audio track to unpublish.
      Returns:
        0: Success, < 0: Failure

    - #### publishVideo

          public int publishVideo(AgoraLocalVideoTrack agoraLocalVideoTrack)

      Publishes the local video track.
      Parameters:
        `agoraLocalVideoTrack` - The local video track to publish.
      Returns:
        0: Success, < 0: Failure

    - #### unpublishVideo

          public int unpublishVideo(AgoraLocalVideoTrack agoraLocalVideoTrack)

      Unpublishes the local video track.
      Parameters:
        `agoraLocalVideoTrack` - The local video track to unpublish.
      Returns:
        0: Success, < 0: Failure

    - #### subscribeAudio

          public int subscribeAudio(java.lang.String userId)

      Subscribes to the audio of a specified user.
      Parameters:
        `userId` - The user ID to subscribe to.
      Returns:
        0: Success, < 0: Failure

    - #### subscribeAllAudio

          public int subscribeAllAudio()

      Subscribes to the audio of all users.
      Returns:
        0: Success, < 0: Failure

    - #### unsubscribeAudio

          public int unsubscribeAudio(java.lang.String userId)

      Unsubscribes from the audio of a specified user.
      Parameters:
        `userId` - The user ID to unsubscribe from.
      Returns:
        0: Success, < 0: Failure

    - #### unsubscribeAllAudio

          public int unsubscribeAllAudio()

      Unsubscribes from the audio of all users.
      Returns:
        0: Success, < 0: Failure

    - #### adjustPlaybackSignalVolume

          public int adjustPlaybackSignalVolume(int volume)

      Adjusts the playback signal volume.
      Parameters:
        `volume` - The volume to set.
      Returns:
        0: Success, < 0: Failure

    - #### getPlaybackSignalVolume

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

      Gets the playback signal volume.
      Parameters:
        `volume` - The output volume.
      Returns:
        0: Success, < 0: Failure

    - #### setPlaybackAudioFrameParameters

          public int setPlaybackAudioFrameParameters(int channels,
                                                     int sampleRateHz,
                                                     int mode,
                                                     int samplesPerCall)

      Sets the playback audio frame parameters.
      Parameters:
        `channels` - The number of channels.
        `sampleRateHz` - The sample rate in Hz.
        `mode` - The mode.
        `samplesPerCall` - The number of samples per call.
      Returns:
        0: Success, < 0: Failure

    - #### setRecordingAudioFrameParameters

          public int setRecordingAudioFrameParameters(int channels,
                                                      int sampleRateHz,
                                                      int mode,
                                                      int samplesPerCall)

      Sets the recording audio frame parameters.
      Parameters:
        `channels` - The number of channels.
        `sampleRateHz` - The sample rate in Hz.
        `mode` - The mode.
        `samplesPerCall` - The number of samples per call.
      Returns:
        0: Success, < 0: Failure

    - #### setMixedAudioFrameParameters

          public int setMixedAudioFrameParameters(int channels,
                                                  int sampleRateHz,
                                                  int samplesPerCall)

      Sets the mixed audio frame parameters.
      Parameters:
        `channels` - The number of channels.
        `sampleRateHz` - The sample rate in Hz.
        `samplesPerCall` - The number of samples per call.
      Returns:
        0: Success, < 0: Failure

    - #### setPlaybackAudioFrameBeforeMixingParameters

          public int setPlaybackAudioFrameBeforeMixingParameters(int channels,
                                                                 int sampleRateHz)

      Sets the playback audio frame parameters before mixing.
      Parameters:
        `channels` - The number of channels.
        `sampleRateHz` - The sample rate in Hz.
      Returns:
        0: Success, < 0: Failure

    - #### subscribeVideo

          public int subscribeVideo(java.lang.String userId,
                                    VideoSubscriptionOptions options)

      Subscribes to the video of a specified user.
      Parameters:
        `userId` - The user ID to subscribe to.
        `options` - The video subscription options.
      Returns:
        0: Success, < 0: Failure

    - #### subscribeAllVideo

          public int subscribeAllVideo(VideoSubscriptionOptions options)

      Subscribes to the video of all users.
      Parameters:
        `options` - The video subscription options.
      Returns:
        0: Success, < 0: Failure

    - #### unsubscribeVideo

          public int unsubscribeVideo(java.lang.String userId)

      Unsubscribes from the video of a specified user.
      Parameters:
        `userId` - The user ID to unsubscribe from.
      Returns:
        0: Success, < 0: Failure

    - #### unsubscribeAllVideo

          public int unsubscribeAllVideo()

      Unsubscribes from the video of all users.
      Returns:
        0: Success, < 0: Failure

    - #### setAudioVolumeIndicationParameters

          public int setAudioVolumeIndicationParameters(int intervalInMs,
                                                        int smooth,
                                                        boolean reportVad)

      Sets the audio volume indication parameters.
      Parameters:
        `intervalInMs` - The interval in milliseconds.
        `smooth` - The smoothness.
        `reportVad` - Whether to report VAD.
      Returns:
        0: Success, < 0: Failure

    - #### getMediaControlPacketSender

          public AgoraMediaCtrlPacketSender getMediaControlPacketSender()

      Gets the media control packet sender.
      Returns:
        The media control packet sender.

    - #### registerMediaControlPacketReceiver

          public int registerMediaControlPacketReceiver(AgoraMediaPacketReceiver agoraMediaPacketReceiver)

      Registers a media control packet receiver.
      Parameters:
        `agoraMediaPacketReceiver` - The media control packet receiver to register.
      Returns:
        0: Success, < 0: Failure

    - #### unregisterMediaControlPacketReceiver

          public int unregisterMediaControlPacketReceiver(AgoraMediaPacketReceiver agoraMediaPacketReceiver)

      Unregisters the media control packet receiver.
      Parameters:
        `agoraMediaPacketReceiver` - The media control packet receiver to unregister.
      Returns:
        0: Success, < 0: Failure

    - #### sendIntraRequest

          int sendIntraRequest(java.lang.String userId)

      Sends an intra request to a specified user.
      Parameters:
        `userId` - The user ID to send the intra request to.
      Returns:
        0: Success, < 0: Failure

    - #### setAudioScenario

          public int setAudioScenario(int scenarioType)

      Sets the audio scenario.
      Parameters:
        `scenarioType` - The audio scenario type to set.
      Returns:
        0: Success, < 0: Failure

    - #### sendAudioMetaData

          int sendAudioMetaData(byte[] metaData)

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

    - #### nativeDestroy

          private int nativeDestroy(long cptr)

      Destroys the native local user instance.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterAudioFrameObserver

          private int nativeRegisterAudioFrameObserver(long cptr,
                                                       AgoraAudioFrameObserverWrapper observer)

      Registers an audio frame observer with the native SDK.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Audio frame observer wrapper
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterAudioFrameObserver

          private int nativeUnregisterAudioFrameObserver(long cptr)

      Unregisters the audio frame observer at the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterAudioEncodedFrameObserver

          private int nativeRegisterAudioEncodedFrameObserver(long cptr,
                                                              IAudioEncodedFrameObserver observer)

      Registers an audio encoded frame observer natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Audio encoded frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterAudioEncodedFrameObserver

          private int nativeUnregisterAudioEncodedFrameObserver(long cptr,
                                                                IAudioEncodedFrameObserver observer)

      Unregisters an audio encoded frame observer natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Audio encoded frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterObserver

          private int nativeRegisterObserver(long cptr,
                                             ILocalUserObserver observer)

      Registers a local user observer with the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Local user observer
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterObserver

          private int nativeUnregisterObserver(long cptr)

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

    - #### nativeRegisterVideoFrameObserver

          private int nativeRegisterVideoFrameObserver(long cptr,
                                                       AgoraVideoFrameObserver2 agoraVideoFrameObserver2)

      Registers a video frame observer with the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraVideoFrameObserver2` - Video frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterVideoFrameObserver

          private int nativeUnregisterVideoFrameObserver(long cptr,
                                                         AgoraVideoFrameObserver2 agoraVideoFrameObserver2)

      Unregisters a video frame observer at the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraVideoFrameObserver2` - Video frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterVideoEncodedFrameObserver

          private int nativeRegisterVideoEncodedFrameObserver(long cptr,
                                                              AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)

      Registers a video encoded frame observer natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraVideoEncodedFrameObserver` - Video encoded frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterVideoEncodedFrameObserver

          private int nativeUnregisterVideoEncodedFrameObserver(long cptr,
                                                                AgoraVideoEncodedFrameObserver agoraVideoEncodedFrameObserver)

      Unregisters a video encoded frame observer natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraVideoEncodedFrameObserver` - Video encoded frame observer
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterCapabilitesObserver

          private int nativeRegisterCapabilitesObserver(long cptr,
                                                        ICapabilitesObserver observer)

      Registers a capabilities observer with the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Capabilities observer
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterCapabilitesObserver

          private int nativeUnregisterCapabilitesObserver(long cptr,
                                                          ICapabilitesObserver observer)

      Unregisters a capabilities observer natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `observer` - Capabilities observer
      Returns:
        0 on success, <0 on failure

    - #### nativeSetUserRole

          private int nativeSetUserRole(long cptr,
                                        int role)

      Sets the user role through the native API.
      Parameters:
        `cptr` - Native pointer to the local user
        `role` - User role to set
      Returns:
        0 on success, <0 on failure

    - #### nativeGetUserRole

          private int nativeGetUserRole(long cptr)

      Gets the user role from the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        User role value

    - #### nativeSetAudioEncoderConfig

          private int nativeSetAudioEncoderConfig(long cptr,
                                                  AudioEncoderConfig config)

      Applies the audio encoder configuration natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `config` - Audio encoder configuration
      Returns:
        0 on success, <0 on failure

    - #### nativeGetLocalAudioStatistics

          private LocalAudioDetailedStats nativeGetLocalAudioStatistics(long cptr)

      Retrieves local audio statistics from the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        Local audio detailed statistics

    - #### nativeDestroyLocalAudioStatistics

          private void nativeDestroyLocalAudioStatistics(long cptr,
                                                         LocalAudioDetailedStats stats)

      Releases local audio statistics objects.
      Parameters:
        `cptr` - Native pointer to the local user
        `stats` - Statistics object to destroy

    - #### nativePublishAudio

          private int nativePublishAudio(long cptr,
                                         AgoraLocalAudioTrack agoraLocalAudioTrack)

      Publishes a local audio track natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraLocalAudioTrack` - Local audio track to publish
      Returns:
        0 on success, <0 on failure

    - #### nativeUnpublishAudio

          private int nativeUnpublishAudio(long cptr,
                                           AgoraLocalAudioTrack agoraLocalAudioTrack)

      Unpublishes a local audio track natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraLocalAudioTrack` - Local audio track to unpublish
      Returns:
        0 on success, <0 on failure

    - #### nativePublishVideo

          private int nativePublishVideo(long cptr,
                                         AgoraLocalVideoTrack agoraLocalVideoTrack)

      Publishes a local video track natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraLocalVideoTrack` - Local video track to publish
      Returns:
        0 on success, <0 on failure

    - #### nativeUnpublishVideo

          private int nativeUnpublishVideo(long cptr,
                                           AgoraLocalVideoTrack agoraLocalVideoTrack)

      Unpublishes a local video track natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraLocalVideoTrack` - Local video track to unpublish
      Returns:
        0 on success, <0 on failure

    - #### nativeSubscribeAudio

          private int nativeSubscribeAudio(long cptr,
                                           java.lang.String userId)

      Subscribes to a remote user's audio stream natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `userId` - Remote user ID
      Returns:
        0 on success, <0 on failure

    - #### nativeSubscribeAllAudio

          private int nativeSubscribeAllAudio(long cptr)

      Subscribes to all remote audio streams natively.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        0 on success, <0 on failure

    - #### nativeUnsubscribeAudio

          private int nativeUnsubscribeAudio(long cptr,
                                             java.lang.String userId)

      Unsubscribes from a remote user's audio stream natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `userId` - Remote user ID
      Returns:
        0 on success, <0 on failure

    - #### nativeUnsubscribeAllAudio

          private int nativeUnsubscribeAllAudio(long cptr)

      Unsubscribes from all remote audio streams natively.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        0 on success, <0 on failure

    - #### nativeAdjustPlaybackSignalVolume

          private int nativeAdjustPlaybackSignalVolume(long cptr,
                                                       int volume)

      Adjusts playback signal volume via the native API.
      Parameters:
        `cptr` - Native pointer to the local user
        `volume` - Volume level to set
      Returns:
        0 on success, <0 on failure

    - #### nativeGetPlaybackSignalVolume

          private int nativeGetPlaybackSignalVolume(long cptr,
                                                    Out<java.lang.Integer> volume)

      Retrieves playback signal volume from the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
        `volume` - Output parameter for volume level
      Returns:
        0 on success, <0 on failure

    - #### nativeSetPlaybackAudioFrameParameters

          private int nativeSetPlaybackAudioFrameParameters(long cptr,
                                                            int channels,
                                                            int sampleRateHz,
                                                            int mode,
                                                            int samplesPerCall)

      Sets playback audio frame parameters on the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `channels` - Number of audio channels
        `sampleRateHz` - Sample rate in Hz
        `mode` - Audio frame mode
        `samplesPerCall` - Samples per call
      Returns:
        0 on success, <0 on failure

    - #### nativeSetRecordingAudioFrameParameters

          private int nativeSetRecordingAudioFrameParameters(long cptr,
                                                             int channels,
                                                             int sampleRateHz,
                                                             int mode,
                                                             int samplesPerCall)

      Sets recording audio frame parameters on the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `channels` - Number of audio channels
        `sampleRateHz` - Sample rate in Hz
        `mode` - Audio frame mode
        `samplesPerCall` - Samples per call
      Returns:
        0 on success, <0 on failure

    - #### nativeSetMixedAudioFrameParameters

          private int nativeSetMixedAudioFrameParameters(long cptr,
                                                         int channels,
                                                         int sampleRateHz,
                                                         int samplesPerCall)

      Sets mixed audio frame parameters on the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `channels` - Number of audio channels
        `sampleRateHz` - Sample rate in Hz
        `samplesPerCall` - Samples per call
      Returns:
        0 on success, <0 on failure

    - #### nativeSetPlaybackAudioFrameBeforeMixingParameters

          private int nativeSetPlaybackAudioFrameBeforeMixingParameters(long cptr,
                                                                        int channels,
                                                                        int sampleRateHz)

      Sets playback-before-mixing parameters natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `channels` - Number of audio channels
        `sampleRateHz` - Sample rate in Hz
      Returns:
        0 on success, <0 on failure

    - #### nativeSubscribeVideo

          private int nativeSubscribeVideo(long cptr,
                                           java.lang.String userId,
                                           VideoSubscriptionOptions options)

      Subscribes to a user's video stream via the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `userId` - Remote user ID
        `options` - Video subscription options
      Returns:
        0 on success, <0 on failure

    - #### nativeSubscribeAllVideo

          private int nativeSubscribeAllVideo(long cptr,
                                              VideoSubscriptionOptions options)

      Subscribes to all video streams via the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
        `options` - Video subscription options
      Returns:
        0 on success, <0 on failure

    - #### nativeUnsubscribeVideo

          private int nativeUnsubscribeVideo(long cptr,
                                             java.lang.String userId)

      Unsubscribes from a user's video stream natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `userId` - Remote user ID
      Returns:
        0 on success, <0 on failure

    - #### nativeUnsubscribeAllVideo

          private int nativeUnsubscribeAllVideo(long cptr)

      Unsubscribes from all video streams natively.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        0 on success, <0 on failure

    - #### nativeSetAudioVolumeIndicationParameters

          private int nativeSetAudioVolumeIndicationParameters(long cptr,
                                                               int intervalInMs,
                                                               int smooth,
                                                               boolean reportVad)

      Configures audio volume indication parameters in the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
        `intervalInMs` - Interval in milliseconds
        `smooth` - Smooth factor
        `reportVad` - Whether to report VAD
      Returns:
        0 on success, <0 on failure

    - #### nativeGetMediaControlPacketSender

          private AgoraMediaCtrlPacketSender nativeGetMediaControlPacketSender(long cptr)

      Retrieves the media control packet sender from the native engine.
      Parameters:
        `cptr` - Native pointer to the local user
      Returns:
        Media control packet sender

    - #### nativeRegisterMediaControlPacketReceiver

          private int nativeRegisterMediaControlPacketReceiver(long cptr,
                                                               AgoraMediaPacketReceiver agoraMediaPacketReceiver)

      Registers a media control packet receiver natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraMediaPacketReceiver` - Media control packet receiver
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterMediaControlPacketReceiver

          private int nativeUnregisterMediaControlPacketReceiver(long cptr,
                                                                 AgoraMediaPacketReceiver agoraMediaPacketReceiver)

      Unregisters a media control packet receiver natively.
      Parameters:
        `cptr` - Native pointer to the local user
        `agoraMediaPacketReceiver` - Media control packet receiver
      Returns:
        0 on success, <0 on failure

    - #### nativeSendIntraRequest

          private int nativeSendIntraRequest(long cptr,
                                             java.lang.String userId)

      Sends an intra request via the native layer.
      Parameters:
        `cptr` - Native pointer to the local user
        `userId` - User ID to send intra request to
      Returns:
        0 on success, <0 on failure

    - #### nativeSetAudioScenario

          private int nativeSetAudioScenario(long cptr,
                                             int scenarioType)

      Sets the audio scenario through the native API.
      Parameters:
        `cptr` - Native pointer to the local user
        `scenarioType` - Audio scenario type
      Returns:
        0 on success, <0 on failure

    - #### nativeSendAudioMetaData

          private int nativeSendAudioMetaData(long cptr,
                                              byte[] metaData)

      Sends audio metadata through the native API.
      Parameters:
        `cptr` - Native pointer to the local user
        `metaData` - Audio metadata to send
      Returns:
        0 on success, <0 on failure