Spatial Voice
Spatial Voice
Spatial Voice (Beta) is a proximity-based voice chat feature that simulates realistic communication based on how close you are to other users who are speaking. The closer you are to another user, the louder their voice; conversely, the farther away you are from another user, the softer their voice.
Note that Spatial Voice is only available for places up to 30 users, and that load an avatar.
Enabling Spatial Voice
Before you begin to enable Spatial Voice, you must first publish your experience:
- In the menu bar, select File. A pop-up menu displays.
- Select Publish to Roblox. A dialog displays.
- Fill in the following fields:
- Title: A title for your experience.
- Description: A description that describes what a potential user should expect.
- Creator: The creator you’d like to attribute as the creator of the experience. If you are using Team Create, every creator appears, otherwise "Me" is the only option.
- Genre: The genre that best describes your experience.
- Devices: Enable each applicable device that supports your experience.
- Click the Create button.
To enable Spatial Voice within an experience:
- In the menu bar, navigate to the Home tab.
- In the Settings section, click on Game Settings. A Game Settings dialog displays.
- In the left-hand navigation, select Options.
- Enable the Spatial Voice toggle.
Spatial Voice is now available in every place in the experience that has their maximum number of users set to 30 or less.
- In the left-hand navigation of the Game Settings dialog, select Places. Every place within your experience displays.
- Click the … button next to the place with more than 30 players, then select Edit.
- In the Max Players field, type in any number equal to or less than 30.
- Click the Save button.
When you update the maximum number of users in a place to less than 30, there may be servers already configured to a different, higher number. As those servers won’t support Spatial Voice, it is recommended to restart your servers.
Restarting Servers
Enabling Spatial Voice may not affect servers currently running your experience, so it is recommended to restart all servers after making this change:
- In the left-hand navigation of the Game Settings dialog, select Options.
- Click the Shutdown button next to the Shutdown All Servers option. A Shutdown All Servers dialog displays.
- Click the Yes button.
Changing Listener Perspective
You can adjust how a user perceives voice and all other sounds within your experience by calling SetListener(). The SoundService listener determines the point from which audio in the experience is heard by the user.
When you use an ObjectPosition ListenerType, you perceive sound through the position of the object while using the orientation of the camera. The sound comes through your device’s left and/or right speaker depending on the orientation of the camera while the volume depends on the object’s distance from the source of the sound.
When you use an ObjectCFrame ListenerType, you perceive sound through the position and orientation of the object. For example, if your character’s head is the object and you face to the right, sound will come through your device’s left speaker since the character’s left ear is now facing the source of the sound, and the volume depends on how close your character is to the source of the sound.
Checking Spatial Voice Status
You can check if a user has enabled Spatial Voice by calling IsVoiceEnabledForUserIdAsync() in a LocalScript.
For example, if you want to enable a UI-layer for voice-enabled players, reference the following script:
Warnings
A warning message will display if a player or place isn’t eligible for Spatial Voice. Reference the following table for possible solutions:
| Warning Message | Resolution |
|---|---|
| Current place is not eligible for Spatial Voice. Spatial Voice is available for places with Max Players <= 30. | Reduce the Max Player value for the place to 30 or less in the Game Settings dialog. |
| Current Player is not eligible to use Spatial Voice. | Players who are a part of the Spatial Voice Beta are eligible to use Spatial Voice. |