Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

readVoiceRoutes

readVoiceRoutes(world, voiceChat): VoiceRoute[]

Every route the game’s voice chat gives on world as it stands: each pair of players a channel admits, with the channel that gives the pair its volume, the volume before the listener’s own controls, and whether the listener hears the speaker from the speaker’s side. It runs the function the room runs after its steps, so a game’s headless test reads who hears whom and how loud: the game’s routing, before a block between two players and each listener’s own mutes, which the room and the player app apply above it. A bot is never routed. Throws for a rule that throws, naming the channel.

Parameter Type
world World
voiceChat VoiceChatSettings

VoiceRoute[]

const routes = readVoiceRoutes(world, voiceChat);
const heard = routes.some(
(route) => route.speaker === ada && route.listener === bea,
);