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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Channels extends Record<string, VoiceChannel> |
object |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
VoiceChatOptions<Channels> |
Returns
Section titled “Returns”VoiceChatSettings<Channels>
Example
Section titled “Example”export const voiceChat = defineVoiceChat({ channels: { nearby: voiceChannel({ proximity: { maxDistance: 35 } }), group: teamVoiceChannel(), },});