public class AgoraAudioFrame
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
buffer
The data buffer of the audio frame.
|
private int |
bytesPerSample
The number of bytes per sample.
|
private int |
channels
The number of audio channels (interleaved if stereo).
|
private int |
sampleRate
The number of samples per channel in the audio frame, should
be 8000, 16000, 24000, 32000, 44100 or 48000.
|
private int |
samplesPerChannel
The number of samples per channel in this frame, should
be (sampleRate / 100) corresponding to 10ms.
|
private int |
type
The audio frame type.
|
| Constructor and Description |
|---|
AgoraAudioFrame() |
AgoraAudioFrame(int type,
int sampleRate,
int channels,
int samplesPerChannel,
int bytesPerSample,
java.nio.ByteBuffer buffer)
Constructs an AgoraAudioFrame with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
getBuffer() |
int |
getBytesPerSample() |
int |
getChannels() |
int |
getSampleRate() |
int |
getSamplesPerChannel() |
int |
getType() |
void |
setBuffer(java.nio.ByteBuffer buffer) |
void |
setBytesPerSample(int bytesPerSample) |
void |
setChannels(int channels) |
void |
setSampleRate(int sampleRate) |
void |
setSamplesPerChannel(int samplesPerChannel) |
void |
setType(int type) |
java.lang.String |
toString() |
private int type
Constants.AudioFrameType.
Default is PCM16.private int sampleRate
private int channels
private int samplesPerChannel
private int bytesPerSample
Constants.BytesPerSample, default
is 2.private java.nio.ByteBuffer buffer
public AgoraAudioFrame()
public AgoraAudioFrame(int type,
int sampleRate,
int channels,
int samplesPerChannel,
int bytesPerSample,
java.nio.ByteBuffer buffer)
type - The audio frame type.sampleRate - The sample rate of the audio frame.channels - The number of audio channels.samplesPerChannel - The number of samples per channel in the audio
frame.bytesPerSample - The number of bytes per sample in the audio frame.buffer - The data buffer of the audio frame.public int getType()
public void setType(int type)
public int getSampleRate()
public void setSampleRate(int sampleRate)
public int getChannels()
public void setChannels(int channels)
public int getSamplesPerChannel()
public void setSamplesPerChannel(int samplesPerChannel)
public int getBytesPerSample()
public void setBytesPerSample(int bytesPerSample)
public java.nio.ByteBuffer getBuffer()
public void setBuffer(java.nio.ByteBuffer buffer)
public java.lang.String toString()
toString in class java.lang.Object