Integration

Voice

How call audio works with pma-voice, mumble-voip and SaltyChat, including speaker mode.

The server owns call audio. When a call is answered it picks a random voice channel, clear of radio channels, puts both parties in it, and takes them out when the call ends. Clients never choose a channel.

luaConfig.Voice = 'auto'   -- 'auto' | 'pma-voice' | 'mumble-voip' | 'saltychat'

auto uses the first one installed: pma-voice, then mumble-voip, then SaltyChat. Start the voice resource before fx-phone.

#What each voice resource does

pma-voice mumble-voip SaltyChat
Joining a call Server export setPlayerCall(src, channel) The server sends the channel to that client, which calls addPlayerToCall Server export AddPlayerToCall(channel, src)
Leaving setPlayerCall(src, 0) Client removePlayerFromCall RemovePlayerFromCall(channel, src)
Speaker Phone UI and bystanders Phone UI and bystanders SetPhoneSpeaker(src, on); SaltyChat makes it audible nearby
Talking indicator MumbleIsPlayerTalking MumbleIsPlayerTalking SaltyChat_TalkStateChanged

#Speaker and bystanders

luaConfig.SpeakerBystanders = true
Config.SpeakerRange = 3.0
Config.SpeakerFalloff = true

On pma-voice and mumble-voip, when a player turns the speaker on, players within Config.SpeakerRange metres are put into the call channel so they hear both sides. The list is refreshed while any speaker is on.

Those voice systems have no listen-only mode, so bystanders can also be heard by the other side. Config.SpeakerBystanders = false turns that off.

With Config.SpeakerFalloff = true the call gets quieter the further a bystander stands from the phone, and so does the bystander for the other side.

SaltyChat handles the speaker itself and ignores these settings.

Settings: Calls configuration.

#Talking indicator

While a call is active the client checks every 200 ms whether the player is talking and tells the other side when it changes. Nothing runs outside calls.

#Death and leaving

A player who dies or disconnects is taken out of the channel and the call ends for both sides (reason = 'dead' or 'unavailable'). Stopping fx-phone takes everyone out of their channels.

#Video calls and live streams

The picture of a video call does not use the voice resource. It travels over WebRTC through a relay: Video relay. The voice stays on the voice resource.

In live streams, Config.Live.Voice = true lets everyone on screen be heard by everyone in the room on pma-voice and mumble-voip.

#Troubleshooting

Symptom Fix
Call connects, nobody hears anything The voice resource started after fx-phone, or Config.Voice names one that is not installed
[fx-phone:voice] pma-voice setPlayerCall failed: ... pma-voice is too old for the setPlayerCall server export; update it
[fx-phone:voice] saltychat AddPlayerToCall failed: ... SaltyChat version without the call exports; update it
Bystanders talk into other people's calls Config.SpeakerBystanders = false

More about calls: Calls and Call exports.