Through referencing a combination of the Lyra Starter Game and the video at https://www.youtube.com/watch?v=7phov5S1jwo , I was able to get voice chat mostly working (almost entirely in C++). However I cannot figure out why when I speak into a headset, it sounds fine in apps such as Discord but very quiet and poor quality in my game.
If I change voice.MicInputGain from 1.0 to 3.0, not only is the volume still quiet but the quality is far worse. Changing the volume for my voice chat bus from 1.0 to 3.0 has no effect.
Other things of note:
My project’s “Voice Chat Volume Control Bus” is set up identically to the Lyra Starter Game.
My project’s “VOIP Sound Class” is set up identically to the Lyra Starter Game.
I am not using any attenuation. All voice chat is radio.
I tried calling SetMicThreshold with a value of -1.0 but it had no effect.
I have a push-to-talk binding that invokes the StopTalking and StartTalking functions on the player controller.
I use VOIP talker components; and when registering with the player, I assign only the source effect chain to the settings.
My VOIP talker components are on the player state, not on any pawn.
I can repro the issue locally using OSS.VoiceLoopback 1 while Steam is not running.
When I use voice.debug.PrintAmplitude, I can see the indicator hovering between 0.2 and 0.5 when I speak normally; and 0.8 when I speak loudly into my mic.
I managed to work around the issue by creating a new preset in my Voice Over IP source effect chain that amplifies the raw samples that came in from the remote speaker by a factor of 5. It sounds significantly better but it also doesn’t exactly blast out my speakers either. Not a fan of an O(N) solution though.
Some other things I did as well:
Assigned Attenuation Settings to my VOIPTalker to make absolutely sure there is no attenuation/spatialization (my project only needs radio comms).
Reduced the default mic volume from 3.0 (300%) to 1.0 (100%) because the problem is not on the speaker’s side (which also eliminated the “tinny” issue).
In my DefaultEngine.ini under [/Script/Engine.AudioSettings] I added VoiPSampleRate=Normal24000Hz to improve sound quality. If I determine through playtesting that this hurts performance, I’ll roll this back.
In my Build.cs file in the PrivateDependencyModuleNames section I added "Voice" to fix a bug where VOIP did not work in packaged release builds.
Next I want to make it so when you’re listening to a remote player talking, the effective Music and SFX volume are reduced via audio modulation. Once that’s working I think I’ll be ready to push the changes to my players.
For convenience, I posted my source files on Pastebin. They won’t compile for you and they aren’t meant to – but they contain code that has my solution which you’re welcome to lift.