Mute a Call Member

Overview

This guide covers muting and unmuting members to a conversation.

Before you begin, make sure you added the SDK to your app and you are able to make or receive calls.

Mute

Mute a member to disables others from hearing the muted member. You can mute your own member or others.

//Mute Member
member.mute(true);

//Mute my Member
conversation.me.mute(true);
private val muteListener = object : NexmoRequestListener<Void> {
    override fun onError(apiError: NexmoApiError) {
        Timber.d("Error: Mute member ${apiError.message}")
    }

    override fun onSuccess(result: Void?) {
        Timber.d("Member muted")
    }
}

val nexmoMember = call?.allMembers?.firstOrNull()
nexmoMember?.enableMute(muteListener)
private NexmoRequestListener<Void> muteListener = new NexmoRequestListener<Void>() {
    @Override
    public void onError(NexmoApiError apiError) {
        Timber.d("Error: Mute member " + apiError.getMessage());
    }

    @Override
    public void onSuccess(@Nullable @org.jetbrains.annotations.Nullable Void result) {
        Timber.d("Member muted");
    }
};

NexmoMember nexmoMember = call.getMyMember();
nexmoMember.enableMute(muteListener);
//Mute Member
member.enableMute()

//Mute my Member
call.myMember?.enableMute()
//Mute Member
[member enableMute];

//Mute my Member
[myCall.myMember enableMute];

Unmute

Unmute a member to allow others to hear a previously muted member.

member.mute(false);

//Unmute my Member
conversation.me.mute(false);
private val muteListener = object : NexmoRequestListener<Void> {
    override fun onError(apiError: NexmoApiError) {
        Timber.d("Error: Unmute member ${apiError.message}")
    }

    override fun onSuccess(result: Void?) {
        Timber.d("Member unmuted")
    }
}

val nexmoMember = call?.myMember
nexmoMember?.disableMute(muteListener)
private NexmoRequestListener<Void> muteListener = new NexmoRequestListener<Void>() {
    @Override
    public void onError(NexmoApiError apiError) {
        Timber.d("Error: Unmute member " + apiError.getMessage());
    }

    @Override
    public void onSuccess(@Nullable @org.jetbrains.annotations.Nullable Void result) {
        Timber.d("Member unmuted");
    }
};

NexmoMember nexmoMember = call.getMyMember();
nexmoMember.disableMute(muteListener);
//Umute Member
member.disableMute()

//Unmute my Member
call.myMember?.disableMute()
//Unmute Member
[member disableMute];

//Unmute my Member
[myCall.myMember disableMute];

Reference