Hey, I was trying to implement voice chat for my game, but I was running into issues with it. I tried to play the Shooter Game UE4 example to see if voice chatting was working there, but we had no luck. I also attempted to use the FOnlineVoiceImpl class, with an OnlineSubsystemNull, to start up voice chat, but had no luck there either. I was wondering if there is an example out there that uses voice chat and see how they implemented it.
Voice chat should be working entirely on its own, but it does depend on having a valid online session that comes from using the session APIs. You can do voice chat with and without “push to talk” and I believe by default push to talk is enabled. If it is enabled then you need to mess with keybindings such that you call StartTalking() and StopTalking(). If you just set it to disabled to start that should remove one of the immediate obstacles as you experiment with it.
[/Script/Engine.GameSession]
bRequiresPushToTalk=true
You should put some breakpoints in RegisterLocalTalk, RegisterRemoteTalker to see how this code works. They are called by RegisterPlayer, which needs an online session to work. If you follow how ShooterGame uses Create/Update/Join/DestroySession calls this will get you on your way.
Documentation is on the way, our tech writers are formatting my notes as we speak.
Very interesting, thanks a lot Josh!
Good to hear. I am planning to use the native VOIP functionality with OnlineSybsystemNull.
edit: Or will I still have to implement a third party library… was hoping there to be native/built-in functionality.
Josh.Markiewicz
Has the documentation for this been finished yet? I was looking to implement something on a local scale and was wondering if I could test this out. I look forward to your reply. Thank you. In addition, does it work from Phone to computer? Or Phone to Phone yet?
Hi,
Any update on this documentation?
Thanks
Anyone figure this part out in particular? I am trying to do a proof of concept and would prefer to not have to go through the Steam green light process.
Sorry for the delay in response. I’ve given my notes to and spoke with our tech writers who were going to do a first pass on the documentation which I would follow up with. I think they’ve been swamped with other documentation areas, but it hopefully is forthcoming.
The Opus based implementation has been around since last December and is actively used by Fortnite. You should be able to use the interface straight up as long as you go through the session code to make sure you create/join sessions. I’ve thought about making the voice code optionally independent of sessions, but it has just been a low priority.
The voice interface is initialized with Steam or NULL subsystems and is actively ticking. It will attempt to process voice data from the microphone if one is plugged in (for now make sure its plugged in at startup). When a player logs in (including host in listen server), they call ClientEnableNetworkVoice(true/false) based on the push to talk flag in defaultgame.ini
[/Script/Engine.GameSession]
bRequiresPushToTalk=false
Functions of interest:
ToggleSpeaking()
StartTalking()
StopTalking()
ClientEnableNetworkVoice()
RegisterLocalTalker()
RegisterLocalTalkers()
MuteRemoteTalker()
GetVoiceDebugState()
Thank you for the response! I am going to get in there and try to get this working! I’ll post back here if I can get it implemented
Why is there still no documentation on the voice interface?
Im curious as where to access ToggleSpeaking() ? or any push to talk functionality with a blueprint only project. I could assign some action mappins, name them whatever, but If I cant assign the push-to-talk functions, it wont help me much…
I suspect there’s still no documentation close to being done, but I’m gonna bump this thread anyway because there really should be some info out there.
I glanced into a couple of the files related to the voip system. ToggleSpeaking() is an APlayerController function but isn’t naturally available in blueprints. There might be some other way to put voice chat in your game without any C++ coding, but I haven’t found anything.
also like to bump this thread. how’s that documentation coming along?
been trying to implement voice chat too but I don’t even know what to expect. is a session required? could I test voice chat on multiplayer clients in the same PC? could I even do it via PlayInEditor multiplayer?
Bumping the thread as also interested, did you ever get an answer to your question
We are interested as well, do we have documentation yet?