io.agora.rtc

## Class AudioPcmFrame

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

-     public class AudioPcmFrame
      extends java.lang.Object

  Represents a PCM audio frame.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `bytesPerSample` Number of bytes per sample
    `private int` | `captureTimestamp` Capture timestamp
    `private short` | `data` Audio data
    `private int` | `numChannels` Number of audio channels
    `private int` | `sampleRateHz` Sample rate in Hz
    `private int` | `samplesPerChannel` Number of samples per channel

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AudioPcmFrame()` Default constructor for AudioPcmFrame.
    `AudioPcmFrame(int captureTimestamp, int samplesPerChannel, int sampleRateHz, int numChannels, int bytesPerSample, short data)` Constructs an AudioPcmFrame with all parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBytesPerSample()` Gets the number of bytes per sample.
    `int` | `getCaptureTimestamp()` Gets the capture timestamp.
    `short` | `getData()` Gets the audio data.
    `int` | `getNumChannels()` Gets the number of audio channels.
    `int` | `getSampleRateHz()` Gets the sample rate in Hz.
    `int` | `getSamplesPerChannel()` Gets the number of samples per channel.
    `void` | `setBytesPerSample(int bytesPerSample)` Sets the number of bytes per sample.
    `void` | `setCaptureTimestamp(int captureTimestamp)` Sets the capture timestamp.
    `void` | `setData(short data)` Sets the audio data.
    `void` | `setNumChannels(int numChannels)` Sets the number of audio channels.
    `void` | `setSampleRateHz(int sampleRateHz)` Sets the sample rate in Hz.
    `void` | `setSamplesPerChannel(int samplesPerChannel)` Sets the number of samples per channel.

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

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

- - ### Field Detail

    - #### captureTimestamp

          private int captureTimestamp

      Capture timestamp

    - #### samplesPerChannel

          private int samplesPerChannel

      Number of samples per channel

    - #### sampleRateHz

          private int sampleRateHz

      Sample rate in Hz

    - #### numChannels

          private int numChannels

      Number of audio channels

    - #### bytesPerSample

          private int bytesPerSample

      Number of bytes per sample

    - #### data

          private short data

      Audio data

  - ### Constructor Detail

    - #### AudioPcmFrame

          public AudioPcmFrame()

      Default constructor for AudioPcmFrame.

    - #### AudioPcmFrame

          public AudioPcmFrame(int captureTimestamp,
                               int samplesPerChannel,
                               int sampleRateHz,
                               int numChannels,
                               int bytesPerSample,
                               short data)

      Constructs an AudioPcmFrame with all parameters.
      Parameters:
        `captureTimestamp` - Capture timestamp
        `samplesPerChannel` - Number of samples per channel
        `sampleRateHz` - Sample rate in Hz
        `numChannels` - Number of audio channels
        `bytesPerSample` - Number of bytes per sample
        `data` - Audio data

  - ### Method Detail

    - #### getCaptureTimestamp

          public int getCaptureTimestamp()

      Gets the capture timestamp.
      Returns:
        Capture timestamp

    - #### setCaptureTimestamp

          public void setCaptureTimestamp(int captureTimestamp)

      Sets the capture timestamp.
      Parameters:
        `captureTimestamp` - Capture timestamp

    - #### getSamplesPerChannel

          public int getSamplesPerChannel()

      Gets the number of samples per channel.
      Returns:
        Number of samples per channel

    - #### setSamplesPerChannel

          public void setSamplesPerChannel(int samplesPerChannel)

      Sets the number of samples per channel.
      Parameters:
        `samplesPerChannel` - Number of samples per channel

    - #### getSampleRateHz

          public int getSampleRateHz()

      Gets the sample rate in Hz.
      Returns:
        Sample rate in Hz

    - #### setSampleRateHz

          public void setSampleRateHz(int sampleRateHz)

      Sets the sample rate in Hz.
      Parameters:
        `sampleRateHz` - Sample rate in Hz

    - #### getNumChannels

          public int getNumChannels()

      Gets the number of audio channels.
      Returns:
        Number of audio channels

    - #### setNumChannels

          public void setNumChannels(int numChannels)

      Sets the number of audio channels.
      Parameters:
        `numChannels` - Number of audio channels

    - #### getBytesPerSample

          public int getBytesPerSample()

      Gets the number of bytes per sample.
      Returns:
        Number of bytes per sample

    - #### setBytesPerSample

          public void setBytesPerSample(int bytesPerSample)

      Sets the number of bytes per sample.
      Parameters:
        `bytesPerSample` - Number of bytes per sample

    - #### getData

          public short getData()

      Gets the audio data.
      Returns:
        Audio data

    - #### setData

          public void setData(short data)

      Sets the audio data.
      Parameters:
        `data` - Audio data