Mute other users
Learn how to let players mute other users.
Read time 1 minuteLast updated 2 days ago
Vivox Unreal provides the following functions to mute another user:
IParticipantProperties::BeginSetLocalMute(bool setMuted, FOnBeginSetLocalMuteCompletedDelegate theDelegate = FOnBeginSetLocalMuteCompletedDelegate())IParticipantProperties::BeginSetIsMutedForAll(bool setMuted, const FString& accessToken, FOnBeginSetIsMutedForAllCompletedDelegate theDelegate = FOnBeginSetIsMutedForAllCompletedDelegate())
BeginSetLocalMuteUsevoid MuteParticipantForMe(IParticipant &participantToMute){ IParticipant::FOnBeginSetLocalMuteCompletedDelegate BeginSetLocalMuteCompletedCallback; bool IsMuted = false; BeginSetLocalMuteCompletedCallback.BindLambda([this, &IsMuted](VivoxCoreError Status) { if(VxErrorSuccess == Status) { IsMuted = true; // This bool is only illustrative. The participant is now muted. } }); participantToMute.BeginSetLocalMute(true, BeginSetLocalMuteCompletedCallback);}
BeginSetIsMutedForAllIParticipantProperties::GetMuteForAllToken()void MuteParticipantForAll(IParticipant &participantToMute){ IParticipant::FOnBeginSetIsMutedForAllCompletedDelegate BeginSetIsMutedForAllCompletedCallback; bool IsMutedForAll = false; BeginSetIsMutedForAllCompletedCallback.BindLambda([this, &IsMutedForAll](VivoxCoreError Status) { if(VxErrorSuccess == Status) { IsMutedForAll = true; // This bool is only illustrative. The participant is now muted. } }); participantToMute.BeginSetIsMutedForAll(true, participantToMute.GetMuteForAllToken(kDefaultKey, kDefaultExpiration), BeginSetIsMutedForAllCompletedCallback);}