Voice support is fully supported on any Steam platform. Additionally I have implemented voice support using the Opus Codec. The codec itself is implemented and integrated for Mac/Linux/Windows, but I have only implemented voice capture support for Windows via DirectSound. The Mac/Linux mic capture would need to be implemented.
Voice capture is implemented in the IVoiceCapture interface.
this handles all voice capture for a platform
Voice codec is implemented via the IVoiceEncoder/IVoiceDecoder interfaces.
these are separated out because we need a decoder per player in opus, since it is stateful
VoIP is handled via IVoiceEngine and IVoiceInterface
the engine handles putting the capture/codec together to provide a packet of data to transmit
the interface handles hooking up the game to the engine so that we can provide muting and transmission
Right now OnlineSubsystemSteam and OnlineSubsystemNull both provide voice chat support using their respective interfaces.
OnlineSubsystem::Tick
Retrieve any local voice data ProcessLocalVoicePackets and add it to an array to be sent out (FVoiceDataImpl for example)
NetDriver::ProcessLocalClientPackets sends packets to the server
NetDriver::ProcessLocalServerPackets sends packets to other clients
Clients receive packets in UVoiceChannel::ReceivedBunch
Packets are opened and given to the IOnlineVoice for processing
IOnlineVoice decompresses the audio and plays it via IVoiceEngine in ProcessRemoteVoicePackets
It should be working in Shootergame, although there may be a few ini settings that need to be verified. Most things should be handled for you, if you use the OnlineSubsystem IOnlineSession. Creating sessions and registering players will set them up to be able to use voice.
If you want push to talk, you’ll need to implement a key input binding and then call Start/StopNetworkedVoice. Look at ToggleSpeaking, an exec function on PlayerController. I’m not well versed on the Input mapping code, but the entries here call exec functions or bind to keys.
Should I be able to hear myself if I talk into a microphone with two players registered to one session? I made the changes to the ini settings that you mentioned and hold down the ‘T’ key in a session with two players but still get no feedback.
I’m not sure Shootergame has push to talk implemented, so you would want to set the bRequiresPushToTalk=false to leave the voice on all the time.
There is a cheat command call DumpVoiceMutingState that will print out a bunch of information when the two players are connected. If you could run that and paste it here it would be helpful.
There is no support for this out of the box right now. The voice packets are handled internally and either routed to the platform APIs (LIVE/Steam) or to our AudioComponent system (NULL) for playback.
You could modify code in the following place to intercept the voice packets.
UVoiceChannel::ReceivedBunch(FInBunch& Bunch)
This serializes the network voice packet and adds it to the VoiceData.RemotePackets variable on most platforms. If you take the packet yourself you’d have to put it back on that array or make sure to play the data somehow.
So sorry for the delay here, it totally slipped the cracks.
Yes, as it currently stands Opus is compiled for Mac and the code should be cross platform. If you received an Opus voice packet it should be decompressed and routed to our AudioComponent which would play on Mac.
That being said, I haven’t tested and in fact think that the factory method for the voice codec interface is probably not enabled on Mac. Could/should be doable.
Implementing Mic capture on Mac hasn’t been prioritized.
dont know what wrong happening on my side.
not OnlineSubsystemSteam .
i am trying it through lan.
do i supposed to do anything for OnlineSubsystemNull ?
Not sure exactly what the problem you are having is. Are you trying to get Steam and instead getting NULL? Do you want NULL and its not working?
Both Steam and NULL interfaces have voice support, but they do require you use the Session APIs to create/join a multiplayer session so UniqueIds for each player are involved. That will allow you to mute players and do other game logic.
There is a thread on the forums where I try to answer this in great detail here.
Hey, just want to make it clear to others something that I’ve only really determined now. The voice module itself is essentially implicit. The only things to implement the basic model is to just make the required changes to the .ini files, and then set up a multiplayer session. There’s no need to delve into the source code yourself.
Hi, I used “OnlineSubsystemNull” to creat/join sessions and followed the setting with Josh. Client could send and receive voice when I tested in editor ,but Server was no voice. When I packaged to two computers and tested each other, there weren’t voice, What 's going wrong? any one can help me,please?