Voice Chat Support
This adds supports for voice chat to Zandronum, allowing players to communicate with each other quickly and easily using their microphones. Key points about this feature include:
-
Voice recording and playback is done using FMOD Ex, like every other sound that's played in Zandronum. Users have the option of transmitting audio to the server using either push-to-talk (the
+voicerecord
bind) or voice activity. For the latter, the sensitivity can also be adjusted to suit the user's needs. -
The server and client each have the option of enabling or disabling voice chat, and with fine control over who can hear them, or be heard by.
-
The server can enable proximity-based voice and adjust how far away a player's voice can still be heard.
-
Audio packets sent to and received from the server are encoded and decoded using Opus: https://github.com/xiph/opus, a cross-platform FOSS library that offers impressive compression results and quality. I recommend using the static libraries when compiling Zandronum. There are no Windows libraries that are publicly available, so one will need to setup Opus in Visual Studio and compile it themselves. However, I can upload my own copies of the static .lib files (in x86 and x86-64) on zandronum.com so that other may use them instead.
-
Noise suppression can be applied to recorded audio with RNNoise before being transmitted to the server. Users may also import their own custom models instead of using the built-in model, if they wish.
-
The volumes of the players' VoIP channels can be adjusted with the CCMDs:
voice_chanvolume
andvoice_chanvolume_idx
. Any value between 0.0-2.0 is acceptable, where anything above 1.0 amplifies the audio. The server remembers what volume the client set for the IP address that corresponds to that player, and will update them when that player reconnects under the same IP address. -
Players' voices can be muted with the CCMDs:
voice_ignore/voice_ignore_idx
, or unmuted withvoice_unignore/voice_unignore_idx
. -
Includes a new menu featuring all relevant voice chat options for the client, as well as a "test microphone" feature so users can hear how their voice sounds.
Other notable changes brought by this feature are:
-
The "ignore a player" menu has been turned into a generic "player list" menu with options to ignore a player's chat messages or voice, or adjust their VoIP channel volume.
-
The server now tells the client when their chat messages or voice are (un)muted. This way, a normal client won't attempt to send chat messages or VoIP packets to the server if they will be immediately discarded, saving bandwidth in the process.