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
- Rust https://rust.facepunch.com/ developed by Facepunch Studios
- PUBG https://www.pubg.com/ developed by PUBG Corporation
- Fortnite https://www.epicgames.com/fortnite/en-US/home developed by Epic Games
- Unreal Engine version 4.19 and above.
- The new audio mixer and associated plugins be enabled. (If not using Unreal Engine 4.24)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Download the Project Files
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.
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!
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!
Hi, Matt ! Thank you for the great tutorial !
I have met a problem when i test it alone on the local laptop. When i press V and speak, the output log says “LogOnlineVoice: OSS：starting networked voice for user:0 ” , but the “start net ” command shows no voice data bytes are being sent and received with the data being all zero.
If you can help, it’d be much appreciated!
UE4 only uses your default audio devices that are set in Windows. Make sure the microphone you want to use is set as default input and communications.
Also if no players are connected, Voice Data might not be sent over the network. Try testing with two clients connected to the same local server.
I meant if you *can* help, it’d be much appreciated. Unfortunate typo there.
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 😀
Thanks for reporting this issue. They should be fixed now. Let me know if you are still having problems with the comment box!
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 ?
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!
Thank you for your answer ! I’ll try this function.
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
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!
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…
Hey Matt, will this see an update for 4.25? I’ve been waiting for epic to add convolution reverb to the engine before version locking and this has been confirmed as done: https://trello.com/c/MJMEV80r/537-convolution-reverb
Would you forsee any issue with adding this verb based on proximity in to the existing setup?
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!
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?
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.
Confused on the set settings part, I can’t find that node
Drag from the SET VOIP variable node and type “Set settings”. This should show the correct node from the tutorial.
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?
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.
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 🙂
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.
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?
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
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)
Would u plz help me with this problem?
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.
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
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?
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.
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.
Thank you for a good tutorial. but, i have some problem. When a new player joins the game, voices are heard by the new player regardless of distance. i found same issue on UE4 Answer hub(https://answers.unrealengine.com/questions/968168/view.html?sort=oldest) but i can’t find any solutions…
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.
What does VOIP audio class mean? You mean to call the Mute / Unmute Function of OnlineSubSystem VoiceInterface?
In the editor you can set an Audio Class to adjust many aspects including the volume. Yes the mute / unmute function in the voice interface. Mostly I use the blueprint exposed functions from the advanced sessions plugin as it makes the whole voip process easier. The documentation for audio classes is here: https://docs.unrealengine.com/en-US/Engine/Audio/Overview/index.html
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…
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.
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.
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.
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++.
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!
Thanks for these tutorials and prompt responses. I can see are quite active in this forum. This tutorial is remarkable as it is the only most useful source I have ever came across for VOIP in UE. It would be nice to have an official documentation by UE but I am done waiting.
I am doing VOIP with Spatial Sound in VR. I also have the exact same setup as you have in your tutorial.
For some strange reason, the audio position is not updated when the VrPawn teleports. Currently the VoiceSettings are attached to the Camera component (Locked to HMD). I expect VOIP to use the World Location and Rotation.
Would you have any suggestions?
I try my best to help out as much as I can!
Have you tried to use Print String nodes to check that the camera component is actually moving when the vr pawn moves?
Another thing to try would be to attach the voip to the root component or collision component of the vr pawn.
Let me know if this fixes the issue.
Thanks for your response Matt. I tried those suggestions to no avail. I think I solved the issue. Apparently I forgot to set “Replicate Movement” on my pawn (which explains a lot). I will get back to you once I confirmed that it works.
Ok so I solved it. My main mistake was not setting “replicate movement” and then believing that positional VOIP attenuation was automatic in pawns.
Turning on replicate movement fixed half the issue. VOIP position is updated correctly on the client side (if the host teleports) but not vice versa. This is of course because the “teleport” function was outside a “switch on authority” node. Because server is authority, it will replicate VrPawn automatically. However, I forgot to RPC from client. Everything is fixed now.
Thanks for your help Matt. Please correct me otherwise but I think (“replicate movement”) note should be added into your tutorial for positional VOIP (in case there are others stupidly lost like me) 🙂
I’m glad that you have your project working correctly now! I have added your little fix to our common voice chat fixes guide. We are working on a front page redesign to hopefully make these important pages easier to find by collecting them together based on topic and tags.
I need to yell into the mic point blank for it to pick up any sound. I have tried various values with “set mic threshold”, like 0, 0.000001, -1, -10, -1000, etc, but none of them seem to make any difference. How can I fix this?
I have responded to your previous message on the Common voice chat fixes guide about this issue.
I’ve refreshed and checked the page multiple times. I do not see my comment or a your response. A response here would be appreciated
I’ve tried 3 times now to follow this tutorial but every time even though they are all separate projects I end up with this error message:
LogVoiceEngine: Error: OSS: StartLocalVoiceProcessing(): Device is currently owned by another user
If someone knows what I am doing wrong please enlighten me.
I am using UE4 4.25
A few things to check:
Are you testing this on two separate PCs in the same network?
Is your voice chat push to talk or continuous?
Do you use the ToggleSpeaking console command?
First of all, thank you for the quick response. I will describe the situation for you.
I have a character that runs the code of creating the VOIP (I am 100% sure this code is correct). Then I also have a player controller that has the key [B] bound to either “ToggleSpeaking” 1 or “ToggleSpeaking” 0 depending on if it’s held down or not. I have tried both push to talk and continuous but neither of them seems to work. When I use push to talk I get the error above and when I use continuous I get nothing at all.
I haven’t tried it on separate computers but seeing, as I get an error and Get Voice Level is returning ‘0’ I am guessing something isn’t working. Even if the voice chat actually works it is still a problem that it returns 0. I am making a horror game that needs to know how loud a player is talking.
I hope I have cleared it up a bit. So if you have any idea why it could be returning 0 that would be of great help.
The best way to test would be to try a packaged version of your project on two PCs. This would completely remove any issues that UE4 might be having with multiple clients accessing the same audio device.
To my knowledge Get Voice Level can only get the level of other players’ voice data and not your own. When I last tried to use this function as an voice volume detection UI element it never changed for the local player’s voice. If attached to the other player’s voice it worked correctly.
I recommend looking into the UE4 microphone input systems and grabbing the local microphone’s voice volume from there.
Let me know if this solves the issue. In the meantime I will keep looking into why this may be happening.
So if I understand this correctly I am unable to get the voice level in the UI?
If so where am I supposed to get the voice level? The only place that comes to mind is the Gamemode. I’ve seen other plugins that can get the mic volume though so I guess I will have to try that.
I will also try the VOIP on separate machines and see if it actually works.
Once again thank you for the help!
You can get the voice level of other players not the local machine using Get Voice Level.
There is a C++ system built in the engine for microphone input if you can do C++. There most likely is plugins that will allow blueprint support for these systems.
I remembered that I actually got the normal non VOIP voice chat to work, it simply stops working when I use VOIP. I tried it on separate PCs and it still doesn’t work. It worked on the same PCs using the non VOIP voice chat. What I mean by that btw is simply “ToggleSpeaking” without any additional components.
If this is the case, make sure that you have followed every step exactly as any changes could cause issues with the VOIPTalker component.
Right, I have kind of solved my problem. I still haven’t got the VOIP to work but I am almost 100% sure it’s a mistake on my part. To get the mic input volume I instead used the “Audio Capture Component” which seems to do the trick.
Thanks again for all the help, seems like VOIP might be something I’ll have to look into in the future.
Thank you so much for the information you are giving us on this blob. I was able to setup my VOIP system using the custom python OSS and it works quite well.
I just had a bit of struggle with the new thresholds added in 4.25 (voice.MicNoiseGateThreshold mainly), but once setup correctly, this works perfectly.
I still want to add a specific feature for the VOIPTalker, but I can’t find any clue:
I’m trying to create an online multiplayer level where there are 2 kind of pawns: players using character pawns and spectator pawns. I would like to have the players talking with sound attenuation, but I would like the spectators pawns to be able to ear the players, no matter how far they are from them, basically disabling the SAT, but only for some players.
Do you think it’s something that could be achieved? Since the VOIPTalker seems to be registered in the player state, it seems that changing its setting change it for all characters. I’m still a beginner with UE and I’m completely lost on that topic.
I am happy that you have voice chat working!
I don’t think there is a way to do this in blueprints just yet. I am looking into this for a personal project as it is something similar to what I need.
The way I think you could achieve this spectator system is to get the source version of the engine and, using C++, make your own version of the VOIPTalker that won’t replicate the settings across to the other clients.
I will keep looking and if I find an easier solution I will post a guide.
Let me know if you get it working :).
Thank you for your fast and clear answer.
This is what I was afraid of.
For the moment, diving directly into the C++ code of the engine is way over my head. If I find some time, I’ll try to check a bit, but I can’t garantee I’ll have the courage.
VOIP seems quite a new and not completely baked feature in UE4, maybe advanced setting will be added in future. Simply removing the location replication of the VOIPTalker object could have a huge fun potential, like adding intercoms to limit the areas or situations where players can communicate together.
Thanks a lot for your explanation! that helped me loads!
After I got it to work, I was having issues with the voice volume and the threshold to which the mic would activate (had to speak very loud to hear not that much) and “Set Mic Threshold” seemed to not do anything to me.
I did however find a bunch of voice commands that did help with this issue: voice.MicNoiseGateThreshold, voice.SilenceDetectionThreshold and voice.MicInputGain. Maybe this is something that could interest you.
I am still having issues with being able to know when I’m speaking to get a visual feedback since “Get Voice Level” doesn’t seem to work properly… if you know how to get that information I would love your input.
Many thanks for all of your help!
Get voice level only works for other players if I recall correctly. I would investigate how to get the volume from the local machines microphone directly instead of through the voice system. When I have time I will try to write a guide about this process.
Thanks for the tutorial, it took me a bit to figure out some of the blueprint connect paths but I think I’ve got everything all set now. My only issue is that I am unable to change anything in the Set Settings Node. When I create it it doesn’t have the same setting option available in the node that the one in your screenshots do. I can see those settings in the details tab when I click on the node but I can’t edit them at all. Sorry if this is super simple but I am completely stuck. I’m using Unreal Engine 4.26 if that helps any.
Hopefully we can get this working for you. Could you send me a screenshot showing exactly how the settings node is affected?
Hi there Matt,
Thanks for collecting all this info on a very sparsely documented feature.
Any idea on how we could get started with the same features using Epic Online Service?
Also, how can we contact you for perhaps some consulting work? I don’t see an email.
The reason I created this site was to make these features easily accessible to all. I’m glad you are finding these resources useful.
I haven’t tried integrating the Epic Online Services yet but I plan to do some guides once I understand it more.
Amazing tutorial sir
My question is, is there a way to make it like a walkie talkie?!!
Meaning same positional features, but like talking over the radio, with signal clarity affected by distance.
There is no way to easily make a walkie talkie using this system. You would have to make a custom effect chain or make your own C++ class to handle that behavior.
Hey Matt, hope you doing well
Thank you for the tutorials works perfectly on PC
However, I’m trying to make this work on my VR HMD Quest 2 but I can only ear other PC players talk on the HMD with positional sound perfectly good but the Quest 2 can’t talk and nobody can ear it
Do you know what may be this issue ?
Using 4.27.2 front Epic Github
The voice chat might be not using the correct audio devices. You will have to use cpp to set the active audio devices.
Can some one make video tutorial on this plz <3