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

defineVoiceChat

defineVoiceChat<Channels>(options?): VoiceChatSettings<Channels>

Declares a game’s voice chat: its channels and who hears whom. Export it from src/game.ts and re-export it from the room’s scene file beside the game, as textChat is. A game with voice that exports none gets one flat all channel. The platform owns the microphone and the playback; a game shapes who hears whom and how loud, never what is said. Throws for a chat with no channel, a channel’s name past 64 characters, and a proximity whose distances or points cannot hold, naming the channel. The chat is frozen as it is made. As Roblox’s VoiceChatService beside its TextChatService.

Type Parameter Default type
Channels extends Record<string, VoiceChannel> object
Parameter Type
options VoiceChatOptions<Channels>

VoiceChatSettings<Channels>

export const voiceChat = defineVoiceChat({
channels: {
nearby: voiceChannel({ proximity: { maxDistance: 35 } }),
group: teamVoiceChannel(),
},
});