Skip to main content
Nov 1, 2018 11:27 PM UTC

VOIP in SDK...

Trying to get the VOIP working by using some c++ from the SDK sample. I'm not too familiar with c++, so it is just a bit of a hack job. I use blueprint to create and join a session, then I've created a BlueprintCallable function that I call in the player controller. Here is the meat of the .cpp (straight from SDK sample):

<CODE>
void UOSSSessionBP::StartVoip(FName SessionName)
{
auto OculusSessionInterface = Online::GetSessionInterface();
auto OculusVoiceInterface = Online::GetVoiceInterface();
auto OculusIdentityInterface = Online::GetIdentityInterface();

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

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

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());
}
}
}
}
</CODE>

Problem is, I don't know how to get the SessionName. Since I create the session using blueprints, I don't know what name it is given or how to get at it. Any suggestions in getting the SessionName or alternate ways to get an array of FUniqueNetIdOculus?
    This topic has been closed for replies.

    5 replies

    Nov 6, 2018 12:14 AM UTC
    I've read the Unreal VOIP documentation. My knowledge of C++ is limited. How do I get the array of players in the session and their corresponding FUniqueNetIdOculus? The example in the SDK gets the array using the SessionName. Since I am creating the session via blueprints, I don't know how to get the SessionName via c++.
    Inspiring
    Nov 19, 2018 2:22 AM UTC
    Apparently UE4 still doesn't support mic input on Android natively :(
    Nov 19, 2018 8:37 AM UTC
    actually it does work since quite a while (mic capturing on Android). It worked pretty well last time I tested it on 4.18 or something similar but it appears there is a bug with it now on the 2nd app load:


    no idea why it wouldn't work the second time but the fact it works on the first load shows it should be working in general ;)

    Inspiring
    Nov 19, 2018 4:32 PM UTC


    actually it does work since quite a while (mic capturing on Android). It worked pretty well last time I tested it on 4.18 or something similar but it appears there is a bug with it now on the 2nd app load:


    no idea why it wouldn't work the second time but the fact it works on the first load shows it should be working in general ;)



    He made that input, it's not Epic's implementation.
    Nov 20, 2018 1:58 PM UTC
    Ah ok bad link - I was testing the Epic implementation when it was first added and I could have sworn was working for me. Can't find a link to it now unforutunately but it was definitely working back then.