With most games becoming multiplayer focussed or having a seperate mode for multiplayer, many users expect rich features on launch. Features even in early access stages of development such as voice chat, friends lists, inviting to parties from AAA to indie titles.
With only a small amount of setup you can add fully working voice chat using only blueprints into your game without any C++ knowledge using any version of Unreal Engine 4.
Before we Start
Unreal Engine’s voice chat only works correctly when your multiplayer game uses the session system. To learn about the session system in Unreal Engine 4 click here.
Setting up Voice Chat
To tell the engine that we want to enable the voice chat features there are a few configuration files (.ini) that need to be changed. The files we need to change are DefaultGame.ini and DefaultEngine.ini. No additional software is needed to change these files. Notepad works fine.
To find these files open your project folder and navigate to the config folder.
Here are the two files we need to edit:
To edit them, right click the file and select open with then click notepad:
Once open, scroll down to the end of the DefaultEngine.ini file and copy and paste this section to enable the voice system on the engine. Save and exit this file.
[Voice] bEnabled=true [OnlineSubsystem] bHasVoiceEnabled=true
DefaultGame.ini is last file that needs to be changed. Open this using the same method as DefaultEngine.ini and paste one of the sections below to enable or disable push to talk.
Enabling push to talk gives your players the ability to only send their voice when pressing a button down.
Disabling push to talk sends voice data all the time regardless if the player wants to send their voice or not.
It is recommended that you enable this as most players prefer their voice data only being sent when they are ready to talk.
To enable push to talk, copy and paste this section:
To disable push to talk, copy and paste this section:
Save and close the file.
Open your project from the .uproject file in your project folder and wait for the engine to load.
If you have enabled push to talk in the DefaultGame.ini file in the above step, you will need to setup key press input to start and stop push to talk. If you did not enable push to talk you can skip to the conclusion.
The first step is to open your player controller blueprint. In my project I have created a new player controller named PlayerControllerVoice.
If you do not have a custom player controller, simply create one from the content browser and assign it to your game mode.
Adding the Voice Chat Key
Once your player controller blueprint is open on the event graph right click anywhere on the empty space and type the name of the key you want your players to press in order to talk. In my case I used the V key.
From the pressed and released pins of the input key event create two “Execute Console Command” nodes.
At this stage it should look like this:
In the command input of the pressed “Execute Console Command” node type:
In the command input of the released “Execute Console Command” node type:
Now when your players press the input key (in my case V) they will start sending voice chat information. When they release the key they will stop sending voice chat information.
Download the Project Files
These example projects have fully working voice chat using the Steam online system using Unreal Engine 4.23.
Voice Chat is now fully working. Completing the additional steps gives you the option of enabling and disabling sending your player’s voice through push to talk!
To improve this system you could do the following:
- Add positional voice chat to your system.
- Add the Advanced Sessions Plugin which gives access to blueprint nodes of many C++ only voice and online features (muting other players, friends lists, inviting players) found here: https://forums.unrealengine.com/community/community-content-tools-and-tutorials/41043-advanced-sessions-plugin
- Use Input actions for push to talk allowing players to rebind their keys
Thanks so much for showing this in a clear, well explained, QUICK manner.
So how to debug it?I don’t know if it can work.
I have a few projects that use this exact system for voice chat so I can assure you it works 100%. You can debug this by looking at the output log in the editor and using the stat net command. The stat net command shows voice chat packet data in and out. Hope this helps.
i am going to add voice and text chat to my VR App, I am interested in your multiplayer Sample, are you using Steam for Voice Chat? Or only the Unreal engine? can o see the video/demo of this project?
Both voice chat demo projects use Unreal Engine Voice Chat described in the guide here, but connect to Steam for easy no port-forward networking. Disabling the Steam system can be done very easily and doesn’t change the Voice Chat system in any way. I will make a demo video now for the example project and upload it to our YouTube channel soon. If you have any other questions let me know!
I have port forwarding setup and everything and am able to join other servers etc. However, the Voice Chat only seems to work over LAN…and, not over the net. Any suggestion? In the main menu, I’ve un-selected both the LAN ONLY options. I am connecting to an external network. I’ve bought the example and tested out of the box as well, still no luck.
Have you made sure your microphones are setup correctly? I have tested these project files both online (port fowarding UDP and TCP 7777) and locally and they both work fine. The only time I had issues was when one person’s microphone wasn’t setup as default in the Windows sound settings. UE4 uses the default microphone so try make sure this is the case.
Let me know if this helped.
Yeah, we checked if it was an issue with the microphones, but it doesn’t seem to be. We tested via other other apps (Voice chats like google meets…). One thing is, I didn’t use ‘Join’, i directly patched in with the public IP. So on the CommandLine i patched in with the Open IPADDRESS:7777 which put me into the level with the other players. Im guessing this is the reason? does joining a listen server through the Public IP not allow for voice to be present? do you suggest any other options.
Ah that explains it! Voice chat only works using the session system. If you create a session and get the other client to join that session it should work correctly. Hopefully this solves your issue.
I purchased the example, This voice is not working over the internet. It works on LAN. However, when I connect to an external network through a public IP i am able to replicate all actions etc. I am not able to communicate via voice.
I also disabled the LAN Only options in the blueprints. Any help would be greatly appreciated.
I have uploaded demo videos for both the positional and non positional voice chat project files. I have linked them below:
Non Positional: https://youtu.be/E9gepdeQiJk
Thank you for your Replay, what I am looking for is a Multiplayer VR Voice Call/Text Chat system on a dedicated server or Steam, can you help us for that?
Dedicated Server is preferred
This system works correctly on Steam with minimal changes. I haven’t tested it but VR and dedicated servers should work fine with this system.
We have a ready to use Steam voice chat project file here on our store.
All you need to do is to add the VR player and plugins into the example project.
First person: https://gumroad.com/couchlearn#CqGkV
Third person: https://gumroad.com/couchlearn#cZliJ
I bought the first person sessions plugin fo £12.
It’s great it has the IP input box so I can develop whilst testing it with others online and not on LAN
The n bought the Voice Chat Third Person for £25 or whatever, which is great, but it’s now missing the IP address input box. Can you let me know how to make that IP input box for the chat third person. How do I get that function back. Sorry. Thanks
When connecting using an IP address directly, the session system is ignored. The IP box was added as a request by another CouchLearn user who wanted to connect to other games without the use of Steam or other subsystems.
The third person voice chat system is designed for use with Steam and thus doesn’t require an IP to connect.
You can use Steam ID 480 to test your game and make sure they work before committing to purchasing a Steam developer license.
If you use an IP address to connect to other games the voice chat system will not work correctly as the NULL subsystem only is compatible with LAN sessions.
Adding an IP address box would break the purpose of this project file download which is why we unfortunately cannot add it.
Please contact us through our contact page if you would like a refund or need any other help.
Matt from CouchLearn
I followed through the example (adding the steps to my own project) but could only get voice working from the machine acting as the listening server. The client could either not be heard at all or was extremely distorted. Out of frustration I bought the project and lo and behold it worked perfectly – however this only seems to be for a 4.23 build. I still get either a distorted client (if I open the bought project in 4.24.2) or no voice at all from the client if I add the steps manually. Do you have any idea what is causing this? I was pleased to see that everything worked in Steam meaning that I could run the executable version of the project in two different networks and see the server to join from a client machine.
I have found from my testing that many features of Unreal Engine 4.24 aren’t working correctly or have issues which is why we predominately use UE 4.23.
Looking through the patch notes of UE 4.25 it seems they fixed a few issues related to the VOIPTalker and voice engine classes in the source so maybe try UE 4.25 with the project.
Hopefully Epic Games will support the in engine voice features more in the future.
UE 4.25 patch notes: https://docs.unrealengine.com/en-US/Support/Builds/ReleaseNotes/4_25/index.html
Do you know why voip stops working after a server travel? Seamless server travel. All functionality just stops.
I have many projects that use Seamless server travel and the voice functionality works correctly on Unreal Engine 4.23. How are you travelling between maps and which engine version are you using?
4.25. I’m just making the server call a multicast that calls a replicated servertravel to a new map. I’m using a tranisition level, and both maps are seamless enabled. My VOIP push to talk button is on my Character, should it be on my PlayerController instead?
Actually I think it’s a problem with registering the talker after a transition… Not sure how to solve that. I’m trying to register talker when the map loads but it’s only half-working. Any idea how to register a talker on map load?
also I am using steam sockets with seamless travel. You have to package the game to test a game with steam sockets sadly.
I always just use an Execute Console Command node and type servertravel yourmapname. This will automatically transfer all clients to a different map without a multicast event. Servertravel is only ran on the server so the multicast event isn’t required.
I don’t have an exact solution for your second issue as UE 4.25 has some issues with registering talkers. A solution could be to add a delay node on your begin play event (~1 second) then register the talker. After this run the normal voiptalker code.
Will this work on IOS, Android and Windows?
It works perfectly on Windows and should work on iOS and Android as the engine functionality does exist but I haven’t verified it.
Thanks for the guide, I have followed all the steps but I am having issues.
I don’t hear my voice playback – is this normal? I have tried inside the editor and also as right-click launching the project. I’m in version 4.26.
Do the voice comms only work in a packaged/launched game?
Do only other players hear my voice?
Am I meant to hear playback?
Are there other steps if I want to connect with other players over steam?
Here is my DefaultEngine.ini
And my DefaultGame.ini