Package io.agora.base

Class AudioFrame

java.lang.Object
io.agora.base.AudioFrame

public class AudioFrame extends Object
  • Field Details

    • buffer

      public ByteBuffer buffer
      The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. The size of the data buffer is as follows: `buffer` = `samples` × `channels` × `bytesPerSample`.
    • sampleRataHz

      public int sampleRataHz
      The number of samples per channel in the audio frame.
    • bytesPerSample

      public int bytesPerSample
      The number of bytes per sample. For PCM, this parameter is generally set to 16 bits (2 bytes).
    • channelNums

      public int channelNums
      The number of audio channels (the data are interleaved if it is stereo). - 1: Mono. - 2: Stereo.
    • samplesPerChannel

      public int samplesPerChannel
      The number of samples per channel in the audio frame.
    • timestamp

      public long timestamp
      The timestamp (ms) of the audio frame.
  • Constructor Details

    • AudioFrame

      public AudioFrame(ByteBuffer buffer, int sampleRataHz, int bytesPerSample, int channelNums, int samplesPerChannel, long timestamp)
  • Method Details

    • getByteBuffer

      public ByteBuffer getByteBuffer()
    • getBytesPerSample

      public int getBytesPerSample()
    • getChannelNums

      public int getChannelNums()
    • getSampleRataHz

      public int getSampleRataHz()
    • getSamplesPerChannel

      public int getSamplesPerChannel()
    • getTimestamp

      public long getTimestamp()
    • toString

      public String toString()
      Overrides:
      toString in class Object