Voice permissions and moderation
Voice permissions are set per player and per channel on the server. Local mute settings affect playback for one listener.
Speaking and listening permissions
Section titled “Speaking and listening permissions”Each channel membership has two independent permissions:
transmit |
listen |
Behavior |
|---|---|---|
true |
true |
Speak and hear other members. |
false |
true |
Listen only. |
true |
false |
Speak without receiving other members’ voices. |
false |
false |
Keep membership with no transmission or reception. |
For a new member, omitted permissions in addPlayer() default to true.
For example, channel.addPlayer(player, { transmit: false, listen: true })
adds a listener. Calling addPlayer() again for an existing member preserves
their current permissions.
Use setPlayerPermissions(player, { transmit, listen }) to change them. Both
fields are required. It returns false when the player is outside the channel.
getPlayerPermissions(player) returns a read-only snapshot or null for a
non-member.
The voice service checks membership and permissions before forwarding audio. Client transmit selection cannot grant access. A player can still speak on other channels where transmission remains permitted.
Server mutes
Section titled “Server mutes”This example revokes transmission on all of the player’s current channels, preserving each channel’s listening permission:
// @ts-check/// <reference types="@revomp/types-server" />import * as revo from 'revo-server';
/** @param {revo.Player} player */function muteVoice(player) { for (const channel of revo.VoiceChannel.all) { const permissions = channel.getPlayerPermissions(player); if (!permissions) continue;
channel.setPlayerPermissions(player, { transmit: false, listen: permissions.listen, }); }}Keep the moderation state in your server logic and include it whenever you add a membership or update permissions. This includes joining a radio, accepting a call and changing speaking mode. Removing and re-adding a member creates new permissions, so the mute policy needs to apply there too.
When lifting a mute, calculate permissions from the player’s current role and
channel access. A listen-only radio member should retain transmit: false.
For mutes that survive reconnects, associate the restriction with the player’s
account and apply it when admitting them to voice channels.
Permission changes reach the voice service asynchronously. Playback can continue briefly while updates and previously queued audio are processed.
Local mutes
Section titled “Local mutes”voice.setPlayerMuted(player, true) silences that speaker for the local listener
across all channels, including proximity, radio and calls. Other listeners and
server permissions remain unchanged.
This example toggles the local mute state:
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
/** @param {revo.Player | number} player */function toggleLocalMute(player) { const muted = revo.voice.isPlayerMuted(player); return revo.voice.setPlayerMuted(player, !muted);}The argument accepts a Player or the speaker’s server ID. A numeric ID also
works for a distant radio or call participant. The setter returns false if
the client does not yet know the player through entity or voice data. Update
the interface after a successful change.
Muting preserves the speaker’s volume setting. Talking indicators and
voice.getPlayerLevel() continue to report received speech while playback is
muted. Use voice.isPlayerMuted() for the interface’s mute state.
Local mute settings remain when the speaker streams out. They reset when the local client disconnects or the resource that last set them stops. A new connection for the speaker starts with default settings, even if their numeric ID is reused. If you keep a persistent local mute list, reapply it when the current player becomes known to the client.
To stop your own outgoing voice through a client interface, use
voice.setTransmitChannels([]). Channel selection is covered in
Radios and calls.
Pause or remove a channel
Section titled “Pause or remove a channel”| Server operation | Result |
|---|---|
channel.enabled = false |
Pause transmission and reception for everyone, preserving memberships and permissions. |
channel.removePlayer(player) |
Remove one membership. |
channel.clearPlayers() |
Remove every membership and keep the channel. |
channel.destroy() |
Remove the channel and all its memberships. |
A disabled channel is absent from the client’s voice.channels. Setting
enabled = true makes it available again with its current memberships and
permissions.
Disconnected players leave all channels automatically. Respawning preserves membership, so a character logout that keeps the connection open needs explicit removal if voice access should end. Empty channels remain until destroyed.