Audio


Contents

1. Audio

2. Actions

3. Listeners

1. Audio

To perform operations on audio, you will need to get an InMeetingAudioController instance from InMeetingService. To implement the audio listeners, getting an InMeetingService instance from ZoomSDK would be helpful.

public MeetingAudioHelper(AudioCallBack callBack) {
    this.callBack = callBack;
    mInMeetingAudioController = ZoomSDK.getInstance().getInMeetingService().getInMeetingAudioController();
    mInMeetingService = ZoomSDK.getInstance().getInMeetingService();
}

2. Action

There are multiple actions you can perform with audio. For example:

// You can check whether the audio is connected by calling `isAudioConnected` method:
public boolean isAudioConnected() {
    return mInMeetingAudioController.isAudioConnected();
}

// You can check whether your audio is muted by calling `isMyAudioMuted` method:
public boolean isMyAudioMuted() {
    return mInMeetingAudioController.isMyAudioMuted();
}

// You can check whether you can unmute your audio by calling `canUnmuteMyAudio` method:
public boolean canUnmuteMyAudio() {
    return mInMeetingAudioController.canUnmuteMyAudio();
}

// You can mute/unmute your audio by calling `muteMyAudio` method:
public void muteMyAudio(boolean mute) {
    mInMeetingAudioController.muteMyAudio(mute);
}

// If you would like to connect audio with "Voice over IP", you can implement the `connectAudioWithVoIP` method:
public void connectAudioWithVoIP() {
    mInMeetingAudioController.connectAudioWithVoIP();
}
// Check whether you can switch audio output.
public boolean canSwitchAudioOutput() {
    return mInMeetingAudioController.canSwitchAudioOutput();
}
// Get the loud speaker status
public boolean getLoudSpeakerStatus() {
    return mInMeetingAudioController.getLoudSpeakerStatus();
}
// Disconnect audio
public void disconnectAudio() {
    mInMeetingAudioController.disconnectAudio();
}
// Switch loud speaker
public void switchLoudSpeaker() {
    if (mInMeetingAudioController.canSwitchAudioOutput()) {
        mInMeetingAudioController.setLoudSpeakerStatus(!mInMeetingAudioController.getLoudSpeakerStatus());
    }
}

3. Listeners

A few listeners are available to you to listen on the audio, for example:

// Listener for when user's audio status changed.
public void onUserAudioStatusChanged(long userId) {
    if (mInMeetingService.isMyself(userId)) {
        if (null != callBack) {
            callBack.updateAudioButton();
        }
    }
}
// Listener for when user's audio type changed.
public void onUserAudioTypeChanged(long userId) {
    if (mInMeetingService.isMyself(userId)) {
        if (null != callBack) {
            callBack.updateAudioButton();
        }
    }
}
// Listener for when my audio source type changed.
public void onMyAudioSourceTypeChanged(int type) {

}