Roblox UtilitiesDevlHub Roblox Documentation

Class

VoiceChatService

NotCreatableService
Inherits
Instance › Object
Memory category
Instances

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#

DefaultDistanceAttenuationVoiceChatDistanceAttenuationTypeDetermines which distance attenuation curve the default voice chat setup uses when AudioDeviceInput and AudioEmitter objects are generated.Read: PluginSecurityWrite: PluginSecurityReadSafe
EnableDefaultVoicebooleanControls whether each voice-eligible player can be heard as though they were speaking through their character.Read: PluginSecurityWrite: PluginSecurityReadSafe
EnableVoiceVolumeControlsRolloutStateControls whether Roblox's built-in voice chat volume controls are available to players.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe
UseAudioApiAudioApiRolloutControls 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:

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#

GetChatGroupsAsyncReturns chat group IDs that indicate which players can voice chat together.Yields
IsVoiceEnabledForUserIdAsyncReturns 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.

NameTypeDefaultDescription
playersInstancesA 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.

NameTypeDefaultDescription
userIdUserThe Player.UserId to check.
Returns
  • boolean — If that user has voice enabled.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed