How to use VOIPTalker Proximity Voice Chat using only Blueprints in your Multiplayer Unreal Engine 4 game

Voice Chat is a staple of modern multiplayer games.

Many games include more open world aspects and the majority of players set their focus on having positional Voice Chat. As a result, this audio data is attenuated (lowered in volume) over distance.

Is VOIPTalker Voice Chat Difficult?

No, not at all!

Implementing Positional Voice Chat into your UE4 multiplayer game only using blueprints is simple and requires very little knowledge of how the backend C++ code works.

Adding this system to my own project initially was very difficult due to the lack of resources available from both the community and Epic themselves on their wiki.

As I don’t want anyone to follow the painful nights of troubleshooting like it did, I have created this guide for the UE4 community to enhance their own projects.

Examples of proximity and positional voice chat 

Requirements

  • Unreal Engine version 4.19 and above.

Complete these requirements to move onto adding the VOIPTalker component.

The VOIPTalker Component

Adding the Component

The VOIPTalker component intercepts voice data and runs it through any effects or attenuation thus preventing player voices playing directly to the players.

Firstly, on your character blueprint, type create the blueprint node named Add VOIPTalker and attach it to your Begin Play event.

 Adding the voice chat component

From the return value pin, promote the new VOIPTalker to a new variable. Call this variable something relevant as we will use this again soon. I named this VOIP.

Adding the voice chat component and promoting it to be used later

Validating the Player State

Next, connected to your Add VOIPTalker node, we need check if the PlayerState is valid and as a result, preventing failure during VOIPTalker’s initialisation.

Checking for a valid player state

There are far more pretty ways of doing this check but reliability and simplicity is key for understanding how this system works.

At this step, the code should look like this.

Positional voice chat blueprints so far

Registering Voice Chat data to the Player State

VOIPTalker in its current setup, can’t receive any voice data.

We now need to assign the correct PlayerState.

Registering positional voice with the player state

Using the Register with Player State node, we can assign the target pin to the promoted variable we created earlier. In the earlier steps we named this VOIP.

In the owning state pin, the PlayerState variable needs to be connected.

Microphone Sensitivity

When using this system I found that the microphone sensitivity was far to low to sustain voice chat without stuttering or cutting out entirely.

To fix this simply create a Set Mic Threshold node and set it to -1.

Setting the voice chat microphone sensitivity

VOIPTalker Voice Settings

We are almost there!

VOIPTalker by default has no effects, location for the sound to originate from or attenuation preset.

From the VOIP variable, drag and type set settings to create this node shown below.

Voice chat audio settings

This node gives us the ability to define the settings we want for our voice chat.

Set Component to Attach to a reference to the player’s camera. This will appear to make the audio originate from the player’s mouth.

I created a specific attenuation class for VOIP which will more accurately reduce volume over distance in the context of speech. You can create and set your own Attenuation class in here and tweak till it sounds right.

If you don’t know how to setup Audio Attenuation in Unreal Engine 4 click here for a simple guide.

In the content browser create a new source effect chain class and leave it empty. Assign the source effect chain setting option to this new class.

Completed Blueprint

The entire system is fairly simple. The lack of documentation is the difficult part.

Here is the complete blueprint nodes all inside my player character blueprint.

Positional voice chat blueprints using VOIPTalker

Example Video

Download the Project Files

Conclusion

Positional Voice Chat should be well documented and developed considering how many games use this feature.

If you found this tutorial useful please share to other developers, family and friends because I believe that this takes very little time to set up and adds a whole dimension of gameplay.

Developers should not have to rely on custom C++ solutions for basic multiplayer features.

Share your thoughts

38 Replies to “How to use VOIPTalker Proximity Voice Chat using only Blueprints in your Multiplayer Unreal Engine 4 game”

  1. Great tutorial, Matt! Thank you!

    How would you suggest debugging it? Suppose someone follows it through and gets a “Device is currently owned by another user” error when V is pressed and “Ignoring stop request for non-owning user” when V is released? If that sounds too specific, it’s because it real. Happening right here. If you can’t help, it’d be much appreciated!

    1. To fix this try moving the V input voice chat code from your character blueprint to your player controller blueprint. The console command ‘stat net’ also shows if voice data bytes are being sent and received which might be helpful for debugging. Comment back if this is still not working and I can look into this further!

  2. Also, the name and email fields here are not working on Firefox. I had to add them in the HTML on my browser debugger to post the comment. Maybe that’s how I got to be the first to comment 😀

  3. Hi Matt ! Thank you again for your tutorials. I managed to make my Google VR Voice Chat project works on a dedicated server !

    Now i’m trying to detect if a player is talking or not, something like a Event IsSpeaking. Do you have any idea if there is a simple way to make this works ?

    1. Thanks for reading my tutorials! I’m really glad that you managed to get your VR project working with this voice chat solution. There isn’t a default event that fires when someone is talking but you can check on your VOIPTalker component for the function that gets the volume of that player’s voice. This function is called: Get Voice Level. Hope this helps!

  4. hello Matt, Thanks for sharing the tutorial. I tried to implement it following yours steps but something strange happens. When I press to to talk, sometimes I can hear the voice of the player but other times I can hear hear the voice or it sounds like a robot .I dont know why that happens. Also The voice chat only works in the lobby, if they move from the lobby to new level through a travel map, the voice of all the players can´t be heard any longer. I dont know if I am doing the things wrong or if the voice chat is not 100% reliable. do you have some Ideas why this happens?. Thanks

    1. I’m glad you found the tutorial useful! If the voice chat is sounding robotic or is stuttering this is usually caused by too many replicated events being fired in a short amount of time.

      Try to make the replicated events fire less frequently (Not on Event Tick) and remove any non necessary parameters on those events. I had the similar issue with one of my projects and I am writing a guide with this fix.

      For your level transfer make sure that you are using the server travel command and if you are using Steam the gamemode must have Seamless Travel enabled.

      Hope this helped!

      1. Thanks for replying Matt, I´ll check to remove non necessary parameters, although I don´t have too many of them in the lobby. In the lobby game mode I have checked Use Seamless Travel and the process to go all players to a certain level from the lobby, is with the console command “servertravel/Game/Maps/Level1”. Despite doing that, I can`t hear the players voices once they leave the lobby. I dont know why…

    1. This guide will almost certainly be the same for 4.25.

      In other projects the proximity voice chat reverb was achieved using audio volumes. Convolution reverb will most likely be an option in the reverb section of the audio volume which already works correctly with this voice chat system.

      Let me know if you have any other questions!

  5. Hi thanks for the tutorial.
    It work perfect in the local Network, but over VPN Voip is not working. Any Idea what could be wrong? Is there a specific port who needs to be open? Any idea? What else we could test?

    Best Regards

    1. To connect on a non LAN game you will need to port forward port 7777 for TCP and UDP on your router. If you are using Steam this isn’t necessary. Let me know if this worked or if you have any other questions.

    1. Drag from the SET VOIP variable node and type “Set settings”. This should show the correct node from the tutorial.

  6. Hi and thanks for this nice little tutorial.

    Is this also working for android? For now I cant get it working and I wonder, is there by default a button I have to press to get the input voice activated? If so, how can I permanently activate the voice input?

    Best
    Aleks

    1. Ok, I found it. I don’t know if it works with android, I can just test tomorrow, but I had to add something to the two ini files to aktivate the VOIP in general and to set pushToTalk to false. I forgot this.

  7. Hi, Im Jihoon 🙂 Im a dev of South Korea.
    Thank u for the such an wonderful tutorial 🙂

    And I would like to ask a question about a problem I’ve experienced

    I’ve done setting steam session n succeded in multiplayer voice chat. Both my colleage(client) and I(server) could hear each other’s voice.

    Then I added VOIP talker to apply attenuation, but that causes a problem 🙁
    We can hear the voice at the beginning, but soon after it seems like the voice audio is turned off.

    Computer Mic is working well, n I’ve tried solving the problem myself but failed 🙁

    I’m assuming that not using oculus mic but a bluetooth earphone or computer linked to several mic(mic of oculus, earphone, and webcam) might be the reason

    Do you have any idea to solve this problem?

    Thank u again for the whole postings u have in this website 🙂

    1. Thanks for your kind words!

      That is great that you have the voice chat system working.

      Unreal Engine sometimes doesn’t use the primary microphone. Try to unplug all other microphones and try just using one. That might fix the problem.

  8. I’ve tried that but unfortunately it still doesn’t work 🙁

    So I’ve purchased your project to see what I have done wrong, but now I’m struggling finding each other

    I’ve created server and my friend did refresh, but cannot find me.

    Could u plz offer a solution for this problem?

    1. I figured it out 🙂 I put the folder under same route in D: Drive, n successed to join with my friend.

      But still the voice chat does not work well 🙁 Feel so frustrated

      I would like to explain the situation 🙂

      Before launching the project, I simply put print string to check if VOIP talk is on/off properly, and to check the voice level. When the voive is loud, the log showed like 0.1274 n when I released the button(stop speaking), it went down to 0.0

      I created the server, n my friend joined. Also tried in the opposite situation.

      When I speak, both the chatting system n attanuation worked properly that my friend could hear my voice

      When my friend speak, I could hear his voice at the beginning, but soon after I couldnt.

      Log was like

      0.193847
      0.130033

      At the beginning,

      But log shows 0.0 in the middle,
      Then it gets sound again,
      Then it gets no sound in the end.

      So the entire log seems like

      No sound(no log)
      0.032222
      0.072233
      0.123442
      0.0
      0.0
      0.093445
      0.123457
      0.193847

      Would u plz help me with this problem?

      1. Try to talk loud into the microphone as I have found issues with some microphones not being loud enough and Unreal Engine 4 doesn’t send the voice data if its too low volume.

        Try to set the “Set Mic Threshold” blueprint node to -10 and see if the voice works with that changed.

  9. Hello 🙂 Thanks for your kind suggestion

    I’ve ordered mic to make sure my problem isn’t due to an unstable connection.

    I’ve tried different versions of UE4 just in case.

    Also, I tried to chat without VOIP talker and found out that now I can hear the other person speaking, but the sound stutters a lot.

    It seems like some basic settings before moving on to use VOIP talker for attenuation are not done well.

    Would you please make some other suggestions to solve this problem? I’m struggling for a few weeks trying to do this 🙁

    Thank you for your contents, once again

    Jihoon

  10. Hi, first at all congrants for the tutorial, really clean design and not much info about it around. Unfortunately I wasn’t lucky, don’t get communication at all, I’ve strange case, my partner can hear me but I never hear, doesn’t matters who create the party, always same respone. I’ve tried on Steam and LAN and same behaviour, recheck de ini files many times, player controller is ready at assignt time the VOIP, I’m crazy searching what is going on, had tried on 4.24 and 4.25, any idea?

    1. Thanks for the support! Try this system on UE4 4.23 as other users have had issues with voice chat using UE 4.24. Every voice chat project I have made using this exact method works in UE 4.23.

      1. Just tried on 4.23 starting from sratch again and get same behaviour. But noticed has same issue than first comment (PedroP):
        LogVoiceEngine: Error: OSS: StartLocalVoiceProcessing(): Device is currently owned by another user

        In my case I had anyway bRequiresPushToTalk=false so, no code for activate the Voice.

    1. I have never encountered this issue with my projects but the solution from that link should work.

      Here is the solution from the link you posted:
      Mute the VOIP audio class by default, check that the player state is valid in a loop, mute and unmute the player and finally set the voip audio back to the desired amount.

  11. Hey do you know if there are any other ways to increase the playercontroller’s VOIPTalker mic gain levels? My friends mic doesnt work in game unless he screams but it works fine in discord…

    1. In the Microphone sensitivity part of the guide, set the value from -1.0 to -10 this will make the microphone more sensitive for all players. Using UI widgets you can make a menu to allow your players to set this using a slider.

      1. Thanks i figured it out, if you know anything about creating multiple types of voip in the same game (prox+team voice chat) please help! I can’t figure out how to add team-based voice chat.

  12. Is there a way to create multiple VOIPTalkers for team-based chat?
    There are literally zero tutorials about team-based VOIP chat on the internet, if you have any knowledge about this please share! I am struggling to figure it out.

    1. I don’t think UE4 has anything built in for team based chat but a workaround would be to mute and unmute players based on their team. The advanced sessions plugin has blueprint functions for muting and unmuting if you didn’t want to use C++.

      1. Hmmm, yea I tried using that but it wouldn’t work. Thanks I’ll keep hammering at it I guess. Would be nice if whoever made this tutorial did one for team chat too, since it’s also essential!

Leave a Reply

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