The easy way to add Voice Chat into your multiplayer Unreal Engine 4 Game

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

Config Files

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:

DefaultEngine.ini

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

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:

[/Script/Engine.GameSession]
bRequiresPushToTalk=true

To disable push to talk, copy and paste this section:

[/Script/Engine.GameSession]
bRequiresPushToTalk=false

Save and close the file.

Open your project from the .uproject file in your project folder and wait for the engine to load.

Finishing Touches

Blueprint Setup

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 player controller to the 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:

ToggleSpeaking 1

In the command input of the released “Execute Console Command” node type:

ToggleSpeaking 0

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.

Example Video

Download the Project Files

These example projects have fully working voice chat using the Steam online system using Unreal Engine 4.23.

Conclusion

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:

Share your thoughts

17 Replies to “The easy way to add Voice Chat into your multiplayer Unreal Engine 4 Game”

    1. 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.

  1. Hello
    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?

    1. 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!

      1. Hey Matt,

        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.

        Kind Regards
        Vamshi

        1. 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.

          1. Hey Matt,

            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.

            Kind Regards
            Vamshi

          2. 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.

      2. Hey Matt,

        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.

        Kind Regards
        Vamshi

      1. 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

  2. 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

    1. 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.

      Thanks,
      Matt from CouchLearn

  3. 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.

    1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *