Class
VoiceChatService
NotCreatableService
VoiceChatService is responsible for voice chat's high-level functionality.
VoiceChatService is responsible for voice chat's high-level functionality. This mostly consists of configuration options, and functions that are not specifically-controlled by more-specific instances.
Properties 4#
DefaultDistanceAttenuationVoiceChatDistanceAttenuationType | Determines which distance attenuation curve the default voice chat setup
uses when AudioDeviceInput and AudioEmitter objects are
generated.Read: PluginSecurityWrite: PluginSecurityReadSafe |
EnableDefaultVoiceboolean | Controls whether each voice-eligible player can be heard as though they were speaking through their character.Read: PluginSecurityWrite: PluginSecurityReadSafe |
EnableVoiceVolumeControlsRolloutState | Controls whether Roblox's built-in voice chat volume controls are available to players.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe |
UseAudioApiAudioApiRollout | Controls whether voice chat is represented and controlled by
AudioDeviceInput objects.Read: PluginSecurityWrite: PluginSecurityReadSafe |
DefaultDistanceAttenuation: VoiceChatDistanceAttenuationType#
Read: PluginSecurityWrite: PluginSecurityReadSafe
This property controls the default distance attenuation curve assigned to
any generated AudioEmitter instances in the default voice chat
setup.
This property only has an effect if
EnableDefaultVoice and
UseAudioApi are both enabled, since
no AudioEmitters are otherwise generated.
EnableDefaultVoice: boolean#
Read: PluginSecurityWrite: PluginSecurityReadSafe
When enabled, each voice-eligible player can be heard as though they were
speaking through their character. The implementation details of the voice
setup depend on UseAudioApi.
When UseAudioApi is
Enabled, disabling this property disables the
default setup, but AudioDeviceInput will still work. Conversely,
when UseAudioApi is
Disabled, disabling the default voice setup
effectively disables voice chat altogether.
EnableVoiceVolumeControls: RolloutState#
Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe
This RolloutState property controls whether Roblox's built-in voice
chat volume controls are available to players, including a global voice
chat volume slider and per-user volume adjustments.
When set to Enabled, these controls are available to
players. When set to Disabled, the built-in controls
are hidden, though creators can still implement their own custom voice
volume controls. Default follows the default for this
feature.
If UseAudioApi is disabled, this
property has no effect and built-in controls will be hidden.
UseAudioApi: AudioApiRollout#
Read: PluginSecurityWrite: PluginSecurityReadSafe
If Enabled, the voice chat setup is represented and
controlled by AudioDeviceInput objects. More specifically:
- An
AudioDeviceInputwill be created and parented to each voice-eligiblePlayer. - An
AudioEmitterwill be created and parented to each voice-eligible player'sPlayer.Character. - An
AudioListenerwill be created and parented toWorkspace.CurrentCamera.
You can disable the default setup by setting
VoiceChatService.EnableDefaultVoice to false.
If Disabled, the voice chat setup is done through
an internal-only system.
Currently, setting this to Automatic has the same
meaning as Disabled. However, in the future,
Automatic will become
Enabled, so that new experiences can achieve
greater customization over voice.
Methods 2#
| GetChatGroupsAsync | Returns chat group IDs that indicate which players can voice chat together.Yields |
| IsVoiceEnabledForUserIdAsync | Returns whether or not the given user has voice enabled.Yields |
GetChatGroupsAsync(players: Instances): Array#
Yields
Returns a sorted array of arrays of chat group IDs for the given players. Each chat group ID is a string that represents a communication-compatible group within the current universe.
If two or more players share the same chat group ID, those players are eligible to voice chat with each other based on their age-check status, voice chat eligibility, and communication settings.
This method is server-side only and intended for real-time use cases such as matchmaking and teleporting. Chat group IDs are unique to the current universe, may change over time, and should not be stored once the user has left the experience. While you can hold onto the data returned for the purposes of gameplay while the user is in the experience, this data should not be stored after they've left.
To use this method, you must enable Chat & Voice Groups APIs in Experience Settings ⟩ Communication in Roblox Studio and agree to the Roblox Terms of Use.
In Roblox Studio this API is only available when the experience is running in Team Test.
| Name | Type | Default | Description |
|---|---|---|---|
players | Instances | A list of Players currently in the experience to
evaluate for voice chat compatibility. |
Returns
Array— A sorted array of arrays of chat group ID strings. Players who share a matching chat group ID are eligible to voice chat with each other.
IsVoiceEnabledForUserIdAsync(userId: User): boolean#
Yields
Returns whether or not the given user has voice enabled. On the client-side, this can only be used to check the voice status of the local player. On the server-side, this can only check the voice status for players in that server.
This function can throw an error if the HTTP call fails.
| Name | Type | Default | Description |
|---|---|---|---|
userId | User | The Player.UserId to check. |
Returns
boolean— If that user has voice enabled.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild