Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
gavmacca's avatar
gavmacca
Protege
8 years ago

UE4 VOIP - Client to client can't hear, but server/client hear each other

Hey Oculus Dev's,

I have followed the platform 1.24.0 SDK guide to get voip up and running, I have got it working between server and client (server can hear client and all clients can hear server) however clients can't actually hear each other.

Below is the function based on the sdk, I'm also not completely sure when and who should call this function, can a dev elaborate on this? (should it be called everytime somebody joins? should everyone have to call it when somebody joins? Server needs to call or just locally? Or both?)

I did some tests and found that it has to be called every time a client joins the server. I'm just looking for the simplest setup of a player joins the session, activate the voip so everyone can hear the new client and the new client can hear everyone else.

This is my function that is called to start VOIP, as you can see it's based exactly on the sdk version:

void UISS_GameInstance::StartVoip()
{
auto OculusSessionInterface = Online::GetSessionInterface();
auto OculusVoiceInterface = Online::GetVoiceInterface();
auto OculusIdentityInterface = Online::GetIdentityInterface();

auto Session = OculusSessionInterface->GetNamedSession(ServerSessionName);
auto UserId = OculusIdentityInterface->GetUniquePlayerId(0);

if (Session)
{
OculusSessionInterface->StartSession(ServerSessionName);//

auto RegisteredPlayers = Session->RegisteredPlayers; //get list of players in the session

for (auto RegisteredPlayer : RegisteredPlayers)
{
//don't register the local player, only the remote
//if (RegisteredPlayer.Get() != *UserId.Get())
//{
OculusVoiceInterface->RegisterRemoteTalker(RegisteredPlayer.Get());
OculusVoiceInterface->StartNetworkedVoice(0);
UE_LOG_ONLINE(Display, TEXT("Registered a Talker: %s"), *RegisteredPlayer.Get().ToString());
//}
VOIPActivated();

}
}
}


Any help would be greatly appreciated, thanks again for your help!

1 Reply

Replies have been turned off for this discussion
  • Thanks for the response @imperativity

    Are you saying that we can't have multiple users connected to each other simultaneously?

    If it is possible, I'm kind of confused as to how approach this, is the SDK example just setup for two users?

    The code sample below works fine for connecting clients to the server, how would I modify this or what steps should I take to connect all connected users to each other? Or is the code below meant to cover it?
    auto RegisteredPlayers = Session->RegisteredPlayers; //get list of players in the session

    for (auto RegisteredPlayer : RegisteredPlayers)
    {
    //don't register the local player, only the remote
    //if (RegisteredPlayer.Get() != *UserId.Get())
    //{
    OculusVoiceInterface->RegisterRemoteTalker(RegisteredPlayer.Get());
    OculusVoiceInterface->StartNetworkedVoice(0);
    UE_LOG_ONLINE(Display, TEXT("Registered a Talker: %s"), *RegisteredPlayer.Get().ToString());
    //}