Voice chat in multiplayer

Hi,

trying to get voice chat to work in a multiplayer game. This is all in blueprint.

I believe I did everything that is necessary:

  • make sure the network session is created with the online subsystem (I use NULL)
  • update DefaultGame.ini with:
    [/Script/Engine.GameSession]
    bRequiresPushToTalk=false
  • update DefaultEngine.ini with:
    [Voice]
    bEnabled=true
    [OnlineSubsystem]
    DefaultPlatformService=Null
    bHasVoiceEnabled=true
  • make sure each PC has got a headset connected and the audio devices are enabled/working
  • also try setting ‘ToggleSpeaking’ to ‘true’, both in a ‘ExecuteConsoleCommand’ node in BP or using console at runtime
  • test in a packaged application, not in PIE
  • disable any applications that may be using the audio device (e.g. skype and such)

But voice chat is not working at all.

I still also get these errors which, judging by the forum posts I have found, appear to be normal. Initially:

  • LogVoiceEngine: Error: StopLocalVoiceProcessing: Ignoring stop request for non-owning user
    and then after passing ‘ToggleSpeaking true’:
  • LogVoiceEngine: Error: StartLocalVoiceProcessing(): Device is currently owned by another user

I can not find anything beyond these things that would help me. Have you guys got any pointers?

Got it working.

In case anyone else has got the same problem: My set-up now covers all of the above settings/checks as posted, EXCEPT there must have been something wrong with how I used the ‘ToggleSpeaking’ command.

Once I passed ‘ToggleSpeaking 1’ for each player, voice chat was working. Only that command did actually need to be given, otherwise the voice chat did not work.

Where to set ‘ToggleSpeaking’ command?

in game press “~” to open command bar

Are you using ‘SteamVoicePlugin’?

Or use the blueprint Console Command node with “ToggleSpeaking 1” in it? Would that work to make it automatic?

Yes, I think I used a Console Command for that somewhere in the logic when everything is being set up at begin play.

I am not using the ‘SteamVoicePlugin’, everything is basic UE.

No, everything is basic UE.

from all i read the voice chat requires you use sessions. is that what you did to get this far? also it suggested that it will work with the lan version of multiplayer where you have a listen server but not with a dedicated server or mmo type setup. any feedback on that info?

I believe it’s true that a properly set up session is required to make voice chat work in an internet multiplayer application. I had a programmer help me on this and even though I don’t fully understand the details I think in the end he implemented an online subsystem that takes care of proper session setup and matchmaking so that voice chat works. Apologies, I don’t understand enough to be more specific.
As far as LAN or Internet is concerned: that was my problem from the get go: in LAN my own setup worked (as detailed in my original post and my feedback below “Got it working…”) but not when running the app over the internet. For that to work I needed to have that custom online subsystem implemented. I went for that custom solution because I also wanted to avoid existing third party platforms like steam. This is all very experimental I guess and I would not suggest this is the best way to go. I myself have not yet taken this any further than to create a working demo.

Hello,

You can use this plugin for voice chat, it works Cross-platform on Windows, Android, iOS. It works on both no session based game and session based game.

You can do global, team and proximity voice chat.
It is optimized with the usage of opus codec,
and you can choose microphone sampling rate and number of channels, you can also get the raw Pcm data of microphone input.

Hello!
Can we exchange this voice chat?I don’t know how to contact you, but I can leave my email address(1281688965@qq.com).I want to contact you by email.