3import java.lang.ref.WeakReference;
4import java.nio.ByteBuffer;
6import us.zoom.common.crossplatform.cmmlib.BuildConfig;
7import us.zoom.core.helper.ZMLog;
8import us.zoom.internal.ErrorCodeMapping;
9import us.zoom.internal.RTCConference;
10import us.zoom.internal.event.RTCConferenceEventUI;
11import us.zoom.internal.event.RTCVideoRawDataDelegate;
12import us.zoom.internal.helper.SDKMeetingInterfaceHelper;
13import us.zoom.internal.impl.ZoomSDKAudioRawDataSender;
14import us.zoom.internal.jni.helper.ZoomMeetingSDKBridgeHelper;
15import us.zoom.internal.sdkcore.delegate.jni.MSDKCoreMeetingServiceHelperDelegateJNI;
22 private static final String
TAG =
"ZoomSDKAudioRawDataHelper";
27 RTCConferenceEventUI.SimpleRTCConferenceEventUIListener
listener;
40 new MSDKCoreMeetingServiceHelperDelegateJNI.SimpleMSDKCoreMeetingServiceHelperDelegate() {
42 public void onCoreConfLeaveComplete(
int ret) {
47 public void onMeetingSilentModeChanged(
int ret) {
48 if (SDKMeetingInterfaceHelper.isInSlientMode()) {
57 public void onMeetingStatusChanged(
MeetingStatus meetingStatus,
int errorCode,
int internalErrorCode) {
67 public void onMeetingParameterNotification(
MeetingParameter meetingParameter) {
76 if (meetingService !=
null) {
83 RTCVideoRawDataDelegate.SimpleRTCVideoRawDataListener
audioRawdataListener =
new RTCVideoRawDataDelegate.SimpleRTCVideoRawDataListener() {
85 public void onUninitialize() {
91 public void onDeviceInitialize(
long nativeHandle) {
98 public void onStartSendData() {
104 public void onStopSendData() {
110 public void onDeviceUninitialize() {
129 if (SDKMeetingInterfaceHelper.isInSlientMode()) {
145 if (
null == RTCConference.getInstance()) {
150 slot.receiver = RTCConferenceEventUI.createIndependentReceiver();
153 slot.weakReference =
new WeakReference<>(delegate);
154 int ret = RTCConference.getInstance().getAudioRawDataHelper().start(
159 slot.receiver =
null;
160 slot.listener =
null;
161 slot.weakReference =
null;
163 ZoomMeetingSDKBridgeHelper.getInstance().trackingMSDKInteractEvent(
TAG,
"subscribe", error.ordinal());
177 if (
null == RTCConference.getInstance()) {
187 slot.weakReference =
null;
188 slot.listener =
null;
189 slot.receiver =
null;
190 int ret = RTCConference.getInstance().getAudioRawDataHelper().stop(sources.
getValue());
192 ZoomMeetingSDKBridgeHelper.getInstance().trackingMSDKInteractEvent(
TAG,
"unSubscribe", error.ordinal());
198 if (
null == RTCConference.getInstance()) {
202 if (SDKMeetingInterfaceHelper.isInSlientMode()) {
205 if (this.virtualAudioMic == audioMic) {
208 this.virtualAudioMic = audioMic;
211 if (
null == audioMic) {
212 result = RTCConference.getInstance().getAudioRawDataHelper().setVirtualAudioMic(0);
216 result = RTCConference.getInstance().getAudioRawDataHelper().setVirtualAudioMic(
rtcAudioRawDataDelegate.getRecevHandle());
219 this.virtualAudioMic =
null;
222 ZoomMeetingSDKBridgeHelper.getInstance().trackingMSDKInteractEvent(
TAG,
"setExternalAudioSource", error.ordinal());
233 return inMeetingService !=
null
250 return delegate == current || delegate == main;
258 if (meetingService !=
null) {
270 if (delegate ==
null || RTCConference.getInstance() ==
null) {
273 RTCConference.getInstance().getAudioRawDataHelper().stop(
275 RTCConference.getInstance().getAudioRawDataHelper().start(
281 return new RTCConferenceEventUI.SimpleRTCConferenceEventUIListener() {
283 public void onMixedAudioRawDataReceived(ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
long timeStamp,
long nativeHandle) {
284 dispatchMixed(slot, buffer, bufferLen, sampleRate, channel, timeStamp, nativeHandle);
288 public void onOneWayAudioRawDataReceivedImpl(ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
int userId,
long timeStamp,
long nativeHandle) {
289 dispatchOneWay(slot, buffer, bufferLen, sampleRate, channel, userId, timeStamp, nativeHandle);
293 public void onShareAudioRawDataReceived(ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
long timeStamp,
long userId,
long nativeHandle) {
294 dispatchShare(slot, buffer, bufferLen, sampleRate, channel, timeStamp, userId, nativeHandle);
299 private void dispatchMixed(
AudioSlot slot, ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
long timeStamp,
long nativeHandle) {
304 if (
null != dataDelegate) {
307 }
else if (BuildConfig.LOG_ENABLE) {
308 ZMLog.d(
TAG,
"onMixedAudioRawDataReceived dataDelegate is null");
312 private void dispatchOneWay(
AudioSlot slot, ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
int userId,
long timeStamp,
long nativeHandle) {
317 if (
null != dataDelegate) {
320 }
else if (BuildConfig.LOG_ENABLE) {
321 ZMLog.d(
TAG,
"onOneWayAudioRawDataReceivedImpl dataDelegate is null");
325 private void dispatchShare(
AudioSlot slot, ByteBuffer buffer,
int bufferLen,
int sampleRate,
int channel,
long timeStamp,
long userId,
long nativeHandle) {
330 if (
null != dataDelegate) {
333 }
else if (BuildConfig.LOG_ENABLE) {
334 ZMLog.d(
TAG,
"onShareAudioRawDataReceived dataDelegate is null");
WeakReference< IZoomSDKAudioRawDataDelegate > weakReference
RTCConferenceEventUI receiver
RTCConferenceEventUI.SimpleRTCConferenceEventUIListener listener
ZoomSDKSessionSource source
RTCConferenceEventUI.SimpleRTCConferenceEventUIListener createSlotListener(final AudioSlot slot)
final AudioSlot currentSlot
void dispatchMixed(AudioSlot slot, ByteBuffer buffer, int bufferLen, int sampleRate, int channel, long timeStamp, long nativeHandle)
boolean isValidSource(ZoomSDKSessionSource sources)
final MeetingServiceListener meetingStatusListener
boolean meetingListenerRegistered
boolean isDelegateInUse(IZoomSDKAudioRawDataDelegate delegate)
MobileRTCRawDataError unSubscribe()
unsubscribe CurrentSession audio raw data
void rebindCurrentSession()
boolean isLocalInWebinarBackstage()
ZoomSDKAudioRawDataHelper()
MobileRTCRawDataError subscribe(IZoomSDKAudioRawDataDelegate delegate, ZoomSDKSessionSource sources)
subscribe audio raw data from one source.
void dispatchOneWay(AudioSlot slot, ByteBuffer buffer, int bufferLen, int sampleRate, int channel, int userId, long timeStamp, long nativeHandle)
IZoomSDKVirtualAudioMicEvent virtualAudioMic
void dispatchShare(AudioSlot slot, ByteBuffer buffer, int bufferLen, int sampleRate, int channel, long timeStamp, long userId, long nativeHandle)
RTCVideoRawDataDelegate.SimpleRTCVideoRawDataListener audioRawdataListener
MSDKCoreMeetingServiceHelperDelegateJNI.SimpleMSDKCoreMeetingServiceHelperDelegate mMSDKCoreMeetingServiceListener
MobileRTCRawDataError subscribe(IZoomSDKAudioRawDataDelegate delegate)
subscribe audio raw data.
void ensureMeetingListener()
AudioSlot getSlot(ZoomSDKSessionSource sources)
MobileRTCRawDataError setExternalAudioSource(IZoomSDKVirtualAudioMicEvent audioMic)
Set external audio source.
RTCVideoRawDataDelegate rtcAudioRawDataDelegate
MobileRTCRawDataError unSubscribe(ZoomSDKSessionSource sources)
unsubscribe audio raw data for one source.
Zoom SDK audio raw data bean.
InMeetingService getInMeetingService()
Gets the in-meeting service instance.
static ZoomSDK getInstance()
Gets a shared instance of Zoom SDK. Must call from the main thread.
MeetingService getMeetingService()
Gets the instance of meeting service.
Enumeration of meeting status.
MEETING_STATUS_JOIN_BACKSTAGE
MEETING_STATUS_LEAVE_BACKSTAGE
MEETING_TYPE_BACKSTAGE
Webinar backstage.
Enumeration of raw data errors.
MobileRTCRawData_WrongUsage
MobileRTCRawData_Uninitialized
MobileRTCRawData_Invalid_Param
SessionSource_CurrentSession
SessionSource_MainSession
Zoom SDK Audio raw data callback.
void onShareAudioRawDataReceived(ZoomSDKAudioRawData rawData, long userId)
share audio raw data received callback
void onOneWayAudioRawDataReceived(ZoomSDKAudioRawData rawData, int userId)
User audio raw data received callback.
void onMixedAudioRawDataReceived(ZoomSDKAudioRawData rawData)
mixed audio raw data received callback
Interface for sending audio raw data.
Interfaces of Zoom services in meeting. The AI Companion brand has been retired. AI-powered features ...
MeetingType getMeetingType()
Gets the type of the current meeting.
void addListener(MeetingServiceListener listener)
void removeListener(MeetingServiceListener listener)
ZOOM meeting service listener.