io.agora.rtc

## Class AgoraAudioTrack

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

-     class AgoraAudioTrack
      extends java.lang.Object

  Represents an Agora audio track and exposes volume and sink control APIs.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer to the audio track resource.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioTrack(long cptr)` Constructs an audio track wrapper.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addAudioSink(AgoraAudioSink agora_audio_sink, AudioSinkWants wants)` Attaches an audio sink to the track.
    `int` | `adjustPlayoutVolume(int volume)` Adjusts the playback volume.
    `int` | `getPlayoutVolume(Out<java.lang.Integer> volume)` Queries the current playback volume.
    `private int` | `nativeAddAudioSink(long cptr, AgoraAudioSink agora_audio_sink, AudioSinkWants wants)` Native method to add an audio sink.
    `private int` | `nativeAdjustPlayoutVolume(long cptr, int volume)` Native method to adjust playback volume.
    `private int` | `nativeGetPlayoutVolume(long cptr, Out<java.lang.Integer> volume)` Native method to query playback volume.
    `private int` | `nativeRemoveAudioSink(long cptr, AgoraAudioSink agora_audio_sink)` Native method to remove an audio sink.
    `int` | `removeAudioSink(AgoraAudioSink agora_audio_sink)` Detaches an audio sink from the track.

    - ### 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 audio track resource.

  - ### Constructor Detail

    - #### AgoraAudioTrack

          public AgoraAudioTrack(long cptr)

      Constructs an audio track wrapper.
      Parameters:
        `cptr` - Native pointer to the audio track

  - ### Method Detail

    - #### adjustPlayoutVolume

          public int adjustPlayoutVolume(int volume)

      Adjusts the playback volume.
      Parameters:
        `volume` - Volume value to set
      Returns:
        Result code from native API

    - #### getPlayoutVolume

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

      Queries the current playback volume.
      Parameters:
        `volume` - Output parameter that receives the volume
      Returns:
        Result code from native API

    - #### addAudioSink

          public int addAudioSink(AgoraAudioSink agora_audio_sink,
                                  AudioSinkWants wants)

      Attaches an audio sink to the track.
      Parameters:
        `agora_audio_sink` - Audio sink to attach
        `wants` - Sink configuration
      Returns:
        Result code from native API

    - #### removeAudioSink

          public int removeAudioSink(AgoraAudioSink agora_audio_sink)

      Detaches an audio sink from the track.
      Parameters:
        `agora_audio_sink` - Audio sink to remove
      Returns:
        Result code from native API

    - #### nativeAdjustPlayoutVolume

          private int nativeAdjustPlayoutVolume(long cptr,
                                                int volume)

      Native method to adjust playback volume.
      Parameters:
        `cptr` - Native pointer
        `volume` - Volume value
      Returns:
        Result code

    - #### nativeGetPlayoutVolume

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

      Native method to query playback volume.
      Parameters:
        `cptr` - Native pointer
        `volume` - Output volume container
      Returns:
        Result code

    - #### nativeAddAudioSink

          private int nativeAddAudioSink(long cptr,
                                         AgoraAudioSink agora_audio_sink,
                                         AudioSinkWants wants)

      Native method to add an audio sink.
      Parameters:
        `cptr` - Native pointer
        `agora_audio_sink` - Audio sink to attach
        `wants` - Sink configuration
      Returns:
        Result code

    - #### nativeRemoveAudioSink

          private int nativeRemoveAudioSink(long cptr,
                                            AgoraAudioSink agora_audio_sink)

      Native method to remove an audio sink.
      Parameters:
        `cptr` - Native pointer
        `agora_audio_sink` - Audio sink to detach
      Returns:
        Result code