Package cn.rongcloud.callplus.api
Class RCCallPlusAudioFrame
-
- All Implemented Interfaces:
public class RCCallPlusAudioFrame
-
-
Field Summary
Fields Modifier and Type Field Description public Array<byte>
bytes
public int
channels
public int
sampleRate
public int
bytesPerSample
public long
timestamp
-
Constructor Summary
Constructors Constructor Description RCCallPlusAudioFrame()
RCCallPlusAudioFrame(Array<byte> bytes, int channels, int sampleRate, int bytesPerSample)
-
Method Summary
Modifier and Type Method Description Array<byte>
getBytes()
声音数据缓存区(如果是双声道,数据是交叉存储的)。 缓存区数据大小 bytes = samples x channels x bytesPerSample void
setBytes(Array<byte> bytes)
设置音频 PCM 数据 int
getChannels()
声道数量(如果是双声道,数据是交叉的)。 void
setChannels(int channels)
设置声道数 [1, 2] int
getSampleRate()
获取音频采样率。一般常用:16000、32000、44100、48000Hz。 void
setSampleRate(int sampleRate)
设置音频采样率 Hz int
getBytesPerSample()
每个采样点的字节数: 对于 PCM 来说,一般使用 16 bit,即两个字节。 void
setBytesPerSample(int bytesPerSample)
long
getTimestamp()
当前音频帧的相对时间戳。 void
setTimestamp(long timestamp)
int
getSamples()
每个声道的采样点数。 -
-
Constructor Detail
-
RCCallPlusAudioFrame
RCCallPlusAudioFrame()
-
RCCallPlusAudioFrame
RCCallPlusAudioFrame(Array<byte> bytes, int channels, int sampleRate, int bytesPerSample)
-
-
Method Detail
-
getBytes
Array<byte> getBytes()
声音数据缓存区(如果是双声道,数据是交叉存储的)。
缓存区数据大小 bytes = samples x channels x bytesPerSample
-
getChannels
int getChannels()
声道数量(如果是双声道,数据是交叉的)。
- Returns:
声道数。单声道: 1 双声道: 2
-
setChannels
void setChannels(int channels)
设置声道数 [1, 2]
-
getSampleRate
int getSampleRate()
获取音频采样率。一般常用:16000、32000、44100、48000Hz。
- Returns:
音频采样率
-
setSampleRate
void setSampleRate(int sampleRate)
设置音频采样率 Hz
-
getBytesPerSample
int getBytesPerSample()
每个采样点的字节数: 对于 PCM 来说,一般使用 16 bit,即两个字节。
- Returns:
每个采样点的字节数
-
setBytesPerSample
void setBytesPerSample(int bytesPerSample)
-
getTimestamp
long getTimestamp()
当前音频帧的相对时间戳。
- Returns:
时间戳
-
setTimestamp
void setTimestamp(long timestamp)
-
getSamples
int getSamples()
每个声道的采样点数。
- Returns:
采样点数
-
-
-
-