Talking indicators and levels
Client scripts can read voice activity through voice.isPlayerTalking() and
voice.getPlayerLevel(). Both accept a Player or a player’s network ID.
Activity combines all voice channels carrying that player’s voice to this client.
Streamed players
Section titled “Streamed players”voice.talkingPlayers returns a frozen snapshot of streamed-in players currently
talking, including the local player while transmitting. Use it to initialize an
indicator when a script starts, then follow playerTalkingStarted and
playerTalkingStopped:
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
const talkingPlayers = new Set(revo.voice.talkingPlayers);
revo.on('playerTalkingStarted', player => { talkingPlayers.add(player);});
revo.on('playerTalkingStopped', player => { talkingPlayers.delete(player);});
revo.on('disconnected', () => { talkingPlayers.clear();});
function getTalkingIndicators() { return Array.from(talkingPlayers, player => ({ player, level: revo.voice.getPlayerLevel(player), muted: revo.voice.isPlayerMuted(player), }));}Call getTalkingIndicators() when updating your indicators. It reads current
levels and mute settings for the tracked players.
The events fire once per player across all channels. A player heard through both proximity voice and radio has one talking indicator.
playerTalkingStarted also fires when an already-talking player streams in.
playerTalkingStopped fires when activity ends or the player streams out, while
the Player is still valid in the callback. Radio or call audio can continue
after stream-out.
Radio and call participants
Section titled “Radio and call participants”For a participant list that includes distant players, query activity by network ID when updating the list:
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
/** @param {readonly number[]} playerNetworkIds */function getParticipantIndicators(playerNetworkIds) { return playerNetworkIds.map(networkId => ({ networkId, talking: revo.voice.isPlayerTalking(networkId), level: revo.voice.getPlayerLevel(networkId), muted: revo.voice.isPlayerMuted(networkId), }));}Supply player IDs from your server’s radio or call state. A server player.id
is that player’s network ID on clients. Include names or other display details
in the participant data and remove entries when players leave or disconnect.
These queries work while voice is received outside entity streaming range.
Unknown or inactive players return false from isPlayerTalking() and 0 from
getPlayerLevel(). The streamed-player events and talkingPlayers list cover
players present in the game world on this client.
Reading levels
Section titled “Reading levels”getPlayerLevel() returns a smoothed RMS signal level between 0 and 1.
The value can drive a meter’s fill or a speaking icon’s intensity. It rises with
incoming audio and decays between frames, returning to 0 when activity ends.
Remote levels are measured before effects, distance attenuation, local mute and
listener volume. A muted player can still appear as talking with a nonzero
level. Read voice.isPlayerMuted() separately to show the local mute state.
Talking state follows voice-frame activity. Quiet frames can keep it active
with a level near 0. After frames stop arriving, a short timeout of about
250 ms clears the state. Both the state and the level are per player, so these
queries do not identify which channel carried the audio.
Local microphone
Section titled “Local microphone”Pass Player.local to the same queries for the local indicator:
| Query | Value |
|---|---|
voice.isPlayerTalking(Player.local) |
Whether the local player is transmitting voice frames. |
voice.getPlayerLevel(Player.local) |
Level of the processed microphone frames being transmitted, before encoding. |
Microphone activation and channel transmit permissions still apply. The Test Microphone setting plays audio locally without transmitting, so it does not activate this indicator.
For channel selection and microphone controls, see Getting started with voice and Radios and calls.