io.agora.rtc

## Class AgoraAudioPcmDataSender

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

-     class AgoraAudioPcmDataSender
      extends java.lang.Object

  Sender for PCM audio data.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraAudioPcmDataSender(long cptr)` Constructs an AgoraAudioPcmDataSender.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys the audio data sender
    `private void` | `nativeDestroy(long cptr)` Native destroy method.
    `private int` | `nativeSend(long cptr, byte[] audioData, int captureTimestamp, long presentationMs, int samplesPerChannel, int bytesPerSample, int numberOfChannels, int sampleRate)` Native method to send PCM audio data.
    `int` | `send(byte[] audioData, int captureTimestamp, long presentationMs, int samplesPerChannel, int bytesPerSample, int numberOfChannels, int sampleRate)` Deprecated. Use `sendAudioPcmData(AudioFrame)` instead
    `int` | `sendAudioPcmData(AudioFrame audioFrame)` Sends audio data

    - ### 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

  - ### Constructor Detail

    - #### AgoraAudioPcmDataSender

          public AgoraAudioPcmDataSender(long cptr)

      Constructs an AgoraAudioPcmDataSender.
      Parameters:
        `cptr` - Native pointer

  - ### Method Detail

    - #### send

          @Deprecated
          public int send(byte[] audioData,
                                      int captureTimestamp,
                                      long presentationMs,
                                      int samplesPerChannel,
                                      int bytesPerSample,
                                      int numberOfChannels,
                                      int sampleRate)

      Deprecated. Use `sendAudioPcmData(AudioFrame)` instead
      Sends audio data
      Parameters:
        `audioData` - The audio data
        `captureTimestamp` - The capture timestamp
        `presentationMs` - The presentation timestamp
        `samplesPerChannel` - The number of samples per channel
        `bytesPerSample` - The number of bytes per sample
        `numberOfChannels` - The number of channels
        `sampleRate` - The sample rate
      Returns:
        The result of sending audio data

    - #### sendAudioPcmData

          public int sendAudioPcmData(AudioFrame audioFrame)

      Sends audio data
      Parameters:
        `audioFrame` - The audio frame
      Returns:
        The result of sending audio data

    - #### destroy

          public void destroy()

      Destroys the audio data sender

    - #### nativeSend

          private int nativeSend(long cptr,
                                 byte[] audioData,
                                 int captureTimestamp,
                                 long presentationMs,
                                 int samplesPerChannel,
                                 int bytesPerSample,
                                 int numberOfChannels,
                                 int sampleRate)

      Native method to send PCM audio data.
      Parameters:
        `cptr` - Native pointer
        `audioData` - Audio data
        `captureTimestamp` - Capture timestamp
        `presentationMs` - Presentation timestamp
        `samplesPerChannel` - Samples per channel
        `bytesPerSample` - Bytes per sample
        `numberOfChannels` - Number of channels
        `sampleRate` - Sample rate
      Returns:
        Result code

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

      Native destroy method.
      Parameters:
        `cptr` - Native pointer