Meeting SDK for Android API Reference
Loading...
Searching...
No Matches
ZoomSDKAudioRawData.java
Go to the documentation of this file.
1package us.zoom.sdk;
2
3import java.nio.ByteBuffer;
4
5import us.zoom.internal.RTCConference;
6
12public class ZoomSDKAudioRawData {
13
14 ByteBuffer buffer;
18 private final long timeStamp;
19 private long nativeHandle = -1;
20
21
22 public ZoomSDKAudioRawData(ByteBuffer buffer, int bufferLen, int sampleRate, int channel, long timeStamp, long nativeHandle) {
23 this.buffer = buffer;
24 this.bufferLen = bufferLen;
25 this.sampleRate = sampleRate;
26 this.channelNum = channel;
27 this.timeStamp = timeStamp;
28 this.nativeHandle = nativeHandle;
29 }
30
31// public ZoomSDKAudioRawData(ByteBuffer buffer, int bufferLen, int sampleRate, long nativeHandle) {
32// this.buffer = buffer;
33// this.bufferLen = bufferLen;
34// this.sampleRate = sampleRate;
35// this.nativeHandle = nativeHandle;
36// }
37
38 public boolean canAddRef() {
39 if (nativeHandle == -1) {
40 return false;
41 }
42 return RTCConference.getInstance().getAudioRawDataHelper().canAddRef(nativeHandle);
43 }
44
45 public void addRef() {
46 if (nativeHandle == -1) {
47 return;
48 }
49 RTCConference.getInstance().getAudioRawDataHelper().addRef(nativeHandle);
50 }
51
52 public void releaseRef() {
53 if (nativeHandle == -1) {
54 return;
55 }
56 int count =RTCConference.getInstance().getAudioRawDataHelper().releaseRef(nativeHandle);
57 if (count <= 0) {
58 nativeHandle = -1;
59 }
60 }
61
67 public ByteBuffer getBuffer() {
68 return buffer;
69 }
70
76 public void setBuffer(ByteBuffer buffer) {
77 this.buffer = buffer;
78 }
79
85 public int getBufferLen() {
86 return bufferLen;
87 }
88
94 public long getTimeStamp() {
95 return timeStamp;
96 }
97
103 public void setBufferLen(int bufferLen) {
104 this.bufferLen = bufferLen;
105 }
106
112 public int getSampleRate() {
113 return sampleRate;
114 }
115
121 public void setSampleRate(int sampleRate) {
122 this.sampleRate = sampleRate;
123 }
124
130 public int getChannelNum() {
131 return channelNum;
132 }
133
139 public void setChannelNum(int channelNum) {
140 this.channelNum = channelNum;
141 }
142
143 public long getNativeHandle() {
144 return nativeHandle;
145 }
146}
int getSampleRate()
Gets the audio sample rate.
void setBuffer(ByteBuffer buffer)
Sets the audio buffer.
void setBufferLen(int bufferLen)
Sets the buffer data length.
ByteBuffer getBuffer()
Gets the audio buffer.
void setChannelNum(int channelNum)
Sets the channel number.
ZoomSDKAudioRawData(ByteBuffer buffer, int bufferLen, int sampleRate, int channel, long timeStamp, long nativeHandle)
void setSampleRate(int sampleRate)
Sets the audio sample rate.
long getTimeStamp()
Gets the timestamp.
int getBufferLen()
Gets the buffer data length.
int getChannelNum()
Gets the channel number.