io.agora.rtc

## Class AgoraLocalAudioTrack

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

-     public class AgoraLocalAudioTrack
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraLocalAudioTrack(long cptr)` Constructor for AgoraLocalAudioTrack.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `adjustPublishVolume(int volume)` Adjusts the publish volume of the local audio track.
    `int` | `clearSenderBuffer()` Clears the sender buffer.
    `void` | `destroy()` Destroys the local audio track.
    `void` | `destroyStats(LocalAudioTrackStats stats)` Destroys the provided LocalAudioTrackStats object.
    `int` | `enableEarMonitor(int enable, int includeAudiFilter)` Enables or disables ear monitoring.
    `int` | `enableLocalPlayback(int enable)` Enables or disables local playback of the audio track.
    `long` | `getNativeHandle()` Gets the native handle of the local audio track.
    `int` | `getPublishVolume(Out volume)` Gets the current publish volume of the local audio track.
    `int` | `getState()` Gets the current state of the local audio track.
    `LocalAudioTrackStats` | `getStats()` Retrieves the statistics of the local audio track.
    `int` | `isEnabled()` Checks if the local audio track is enabled.
    `private int` | `nativeAdjustPublishVolume(long cptr, int volume)`
    `private int` | `nativeClearSenderBuffer(long cptr)`
    `private void` | `nativeDestroy(long cptr)`
    `private void` | `nativeDestroyStats(long cptr, LocalAudioTrackStats stats)`
    `private int` | `nativeEnableEarMonitor(long cptr, int enable, int includeAudiFilter)`
    `private int` | `nativeEnableLocalPlayback(long cptr, int enable)`
    `private int` | `nativeGetPublishVolume(long cptr, Out volume)`
    `private int` | `nativeGetState(long cptr)`
    `private LocalAudioTrackStats` | `nativeGetStats(long cptr)`
    `private int` | `nativeIsEnabled(long cptr)`
    `private void` | `nativeSetEnabled(long cptr, int enable)`
    `private void` | `nativeSetMaxBufferedAudioFrameNumber(long cptr, int number)`
    `private void` | `nativeSetSendDelayMs(long cptr, int delayMs)`
    `void` | `setEnabled(int enable)` Enables or disables the local audio track.
    `void` | `setMaxBufferedAudioFrameNumber(int number)` Sets the maximum number of buffered audio frames.
    `void` | `setSendDelayMs(int delayMs)` Sets the send delay in milliseconds.

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

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

- - ### Field Detail

    - #### cptr

          private long cptr

  - ### Constructor Detail

    - #### AgoraLocalAudioTrack

          public AgoraLocalAudioTrack(long cptr)

      Constructor for AgoraLocalAudioTrack.
      Parameters:
        `cptr` - Pointer to the native audio track object.

  - ### Method Detail

    - #### getNativeHandle

          public long getNativeHandle()

      Gets the native handle of the local audio track.
      Returns:
        The native handle of the local audio track.

    - #### destroy

          public void destroy()

      Destroys the local audio track. Ensures that the native resources are released.

    - #### setEnabled

          public void setEnabled(int enable)

      Enables or disables the local audio track.
      Parameters:
        `enable` - 1 to enable, 0 to disable.

    - #### isEnabled

          public int isEnabled()

      Checks if the local audio track is enabled.
      Returns:
        1 if enabled, 0 if disabled.

    - #### getState

          public int getState()

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

    - #### getStats

          public LocalAudioTrackStats getStats()

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

    - #### destroyStats

          public void destroyStats(LocalAudioTrackStats stats)

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

    - #### adjustPublishVolume

          public int adjustPublishVolume(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.

    - #### getPublishVolume

          public int getPublishVolume(Out 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.

    - #### enableLocalPlayback

          public int enableLocalPlayback(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.

    - #### enableEarMonitor

          public int enableEarMonitor(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.

    - #### setMaxBufferedAudioFrameNumber

          public void setMaxBufferedAudioFrameNumber(int number)

      Sets the maximum number of buffered audio frames.
      Parameters:
        `number` - The maximum number of frames to buffer.

    - #### clearSenderBuffer

          public int clearSenderBuffer()

      Clears the sender buffer.
      Returns:
        0 on success, <0 on failure.

    - #### setSendDelayMs

          public void setSendDelayMs(int delayMs)

      Sets the send delay in milliseconds.
      Parameters:
        `delayMs` - The delay in milliseconds.

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

    - #### nativeSetEnabled

          private void nativeSetEnabled(long cptr,
                                        int enable)

    - #### nativeIsEnabled

          private int nativeIsEnabled(long cptr)

    - #### nativeGetState

          private int nativeGetState(long cptr)

    - #### nativeGetStats

          private LocalAudioTrackStats nativeGetStats(long cptr)

    - #### nativeDestroyStats

          private void nativeDestroyStats(long cptr,
                                          LocalAudioTrackStats stats)

    - #### nativeAdjustPublishVolume

          private int nativeAdjustPublishVolume(long cptr,
                                                int volume)

    - #### nativeGetPublishVolume

          private int nativeGetPublishVolume(long cptr,
                                             Out volume)

    - #### nativeEnableLocalPlayback

          private int nativeEnableLocalPlayback(long cptr,
                                                int enable)

    - #### nativeEnableEarMonitor

          private int nativeEnableEarMonitor(long cptr,
                                             int enable,
                                             int includeAudiFilter)

    - #### nativeSetMaxBufferedAudioFrameNumber

          private void nativeSetMaxBufferedAudioFrameNumber(long cptr,
                                                            int number)

    - #### nativeClearSenderBuffer

          private int nativeClearSenderBuffer(long cptr)

    - #### nativeSetSendDelayMs

          private void nativeSetSendDelayMs(long cptr,
                                            int delayMs)