Hi,
I’m having an issue with EOS Voice Chat and updating participant statuses.
I’m logged in successfully, and voice chat itself is working — participants can hear each other in the room. However, I’m unable to mute other participants, mute myself, or mute incoming audio from the voice room.
I also get a log message indicating that the participant was not found, but I’m not sure why this is happening.
Has anyone encountered a similar issue or knows what could cause the participant to not be found when trying to update their status?
Any help or guidance would be greatly appreciated. Thanks!
Below is code (login, joining, muting) and logs.
void UCustomGameInstance::LoginToEpicServices()
{
const TSharedPtr<UE::Online::IOnlineServices> OnlineServices = UE::Online::GetServices(UE::Online::EOnlineServices::Epic);
if (!OnlineServices)
{
UE_LOG(LogGameInstance, Error, TEXT("No online services found!"));
return;
}
const UE::Online::IAuthPtr AuthInterface = OnlineServices->GetAuthInterface();
if (!AuthInterface)
{
UE_LOG(LogGameInstance, Error, TEXT("No auth interface found!"));
return;
}
UE::Online::FAuthLogin::Params LoginParams;
LoginParams.CredentialsType = UE::Online::LoginCredentialsType::ExternalAuth;
LoginParams.PlatformUserId = FPlatformMisc::GetPlatformUserForUserIndex(0);
UE::Online::FExternalAuthToken AuthToken;
AuthToken.Type = UE::Online::ExternalLoginType::OpenIdAccessToken;
AuthToken.Data = UserToken;
LoginParams.CredentialsToken.Set<UE::Online::FExternalAuthToken>(AuthToken);
AuthInterface->Login(MoveTemp(LoginParams))
.OnComplete([this](const UE::Online::TOnlineResult<UE::Online::FAuthLogin>& Result)
{
if (Result.IsOk())
{
EpicServicesAccount = Result.GetOkValue().AccountInfo.Get();
LoginToVoiceChatService();
}
});
}
void UCustomGameInstance::LoginToVoiceChatService()
{
IVoiceChat* VoiceChat = IVoiceChat::Get();
VoiceChat->Initialize();
VoiceChat->Connect(FOnVoiceChatConnectCompleteDelegate::CreateLambda([this, VoiceChat](const FVoiceChatResult& Result)
{
if (Result.IsSuccess())
{
VoiceChatPtr = VoiceChat->CreateUser();
VoiceChatPtr->Login(
EpicServicesAccount.PlatformUserId,
LexToString(GetProductUserId(EpicServicesAccount.AccountId)),
TEXT(""),
FOnVoiceChatLoginCompleteDelegate::CreateUObject(this, &UCustomGameInstance::OnVoiceChatLoginComplete)
);
}
}));
}
void UCustomGameInstance::JoinVoiceChannel(const FString& RoomName, const FString& Url, const FString& Token) const
{
if (!VoiceChatPtr)
{
UE_LOG(LogGameInstance, Error, TEXT("VoiceChat user is not valid!"));
return;
}
FEOSVoiceChatChannelCredentials ChannelCredentials;
ChannelCredentials.ClientBaseUrl = Url;
ChannelCredentials.ParticipantToken = Token;
VoiceChatPtr->JoinChannel(
RoomName,
ChannelCredentials.ToJson(),
EVoiceChatChannelType::NonPositional,
FOnVoiceChatChannelJoinCompleteDelegate::CreateLambda([this](const FString& ChannelName, const FVoiceChatResult& Result)
{
if (Result.IsSuccess())
{
UE_LOG(LogGameInstance, Log, TEXT("Successfully joined channel: %s"), *ChannelName);
}
})
);
}
void UCustomGameInstance::ToggleMuteVoiceChatUser() const
{
if (VoiceChatPtr && !VoiceChatParticipantName.IsEmpty())
{
const bool NewState = !VoiceChatPtr->IsPlayerMuted(VoiceChatParticipantName);
VoiceChatPtr->SetPlayerMuted(VoiceChatParticipantName, NewState);
}
}
LogEOSVoiceChat: [000002444E133C50] SetPlayerMuted PlayerName=[00022…] bAudioMuted=[true]
LogEOSSDK: LogEOSRTC: RTCAudio UpdateReceiving. Target=[[PUID]000…f0a] State=[Disabled] LocalUserId=[[PUID]000…f0a] RoomName=[XYZ]
LogEOSSDK: Warning: LogEOSRTC: RTCAudio UpdateReceiving Updated Participant not found. ParticipantId=[[PUID]000…f0a] LocalUserId=[[PUID]000…f0a] RoomName=[XYZ]
LogEOSVoiceChat: Warning: [000002444E133C50] OnUpdateReceiving ChannelName=[XYZ] PlayerName=[00022…] failed error=[EOS_NotFound]
LogEOSVoiceChat: Warning: [000002444E133C50] OnUpdateParticipantVolume ChannelName=[XYZ] PlayerName=[00022…] failed error=[EOS_NotFound]