Package com.zego.zegoavkit2.entities
Class ZegoAudioFrame
- java.lang.Object
-
- com.zego.zegoavkit2.entities.ZegoAudioFrame
-
public class ZegoAudioFrame extends java.lang.Object
音频帧数据。Copyright © 2017 Zego. All rights reserved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZegoAudioFrame.FrameType
帧数据编码类型
-
Field Summary
Fields Modifier and Type Field Description java.nio.ByteBuffer
buffer
data buffer, the caller is responsible for bufer allocate and release.int
bufLen
buffer Length, PCM bufLen = 2 * samples * channels(only need correct fill samples and channels, not use filed bufLen).int
bytesPerSample
bytes per sample, only support 2 bytes per sample.int
channels
channels, 1 or 2.int
configLen
aac special config Len, PCM: 0; AAC: range [0-64].int
frameType
refer to FrameType.int
sampleRate
PCM: capture sample rate; AAC: encode sample rate.int
samples
PCM:capture pcm samples at this input.double
timeStamp
time stamp, PCM: 0; AAC: 0 or encode timeStamp, if buffer data only contain special config fill 0.
-
Constructor Summary
Constructors Constructor Description ZegoAudioFrame()
-
-
-
Field Detail
-
frameType
public int frameType
refer to FrameType.
-
samples
public int samples
PCM:capture pcm samples at this input. AAC:aac encode one frame need samples.
-
bytesPerSample
public int bytesPerSample
bytes per sample, only support 2 bytes per sample.
-
channels
public int channels
channels, 1 or 2.
-
sampleRate
public int sampleRate
PCM: capture sample rate; AAC: encode sample rate. supported [16k/32k/44.1k/48k].
-
timeStamp
public double timeStamp
time stamp, PCM: 0; AAC: 0 or encode timeStamp, if buffer data only contain special config fill 0.
-
configLen
public int configLen
aac special config Len, PCM: 0; AAC: range [0-64]. 0 indicate this frame not contain spcial config.
-
bufLen
public int bufLen
buffer Length, PCM bufLen = 2 * samples * channels(only need correct fill samples and channels, not use filed bufLen). AAC encode data len = bufLen - configLen.
-
buffer
public java.nio.ByteBuffer buffer
data buffer, the caller is responsible for bufer allocate and release.注意: 必须使用
ByteBuffer.allocateDirect(int)
创建buffer, 否则数据无法传递给sdk
-
-