Package io.agora.base
Class AudioFrame
java.lang.Object
io.agora.base.AudioFrame
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe data buffer of the audio frame.intThe number of bytes per sample.intThe number of audio channels (the data are interleaved if it is stereo).intThe number of samples per channel in the audio frame.intThe number of samples per channel in the audio frame.longThe timestamp (ms) of the audio frame. -
Constructor Summary
ConstructorsConstructorDescriptionAudioFrame(ByteBuffer buffer, int sampleRataHz, int bytesPerSample, int channelNums, int samplesPerChannel, long timestamp) -
Method Summary
-
Field Details
-
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 sampleRataHzThe number of samples per channel in the audio frame. -
bytesPerSample
public int bytesPerSampleThe number of bytes per sample. For PCM, this parameter is generally set to 16 bits (2 bytes). -
channelNums
public int channelNumsThe number of audio channels (the data are interleaved if it is stereo). - 1: Mono. - 2: Stereo. -
samplesPerChannel
public int samplesPerChannelThe number of samples per channel in the audio frame. -
timestamp
public long timestampThe 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