Basically this but uses the new audio APIs.
EDIT SINCE IT WASN’T OBVIOUS: You need to have the new Audio APIs enabled.
How to enable the new Audio APIs
Right-click the Explorer and press Show Services...
; It should open this window;
Click on VoiceChatService and click on Insert
.
It will now add the service into your Explorer window.
Under the service’s properties, you will be able enable the UseAudioApi
, as shown here;
Alternatively, enable the Command Bar in the VIEW
tab;
and paste this script in the command bar, and press Enter
.
game:GetService("VoiceChatService").UseAudioApi = Enum.AudioApiRollout.Enabled
VoiceChatSDK is a small module made to originally moderate misbehaving players, while also knowing if they get suspended from the Voice Chat to just simply knowing whether they can Voice Chat to begin with.
The module can be used both on the Server and Client, and is fully compatible with --!strict
.
Functions that are included
MutePlayer ( Player, Seconds? ) -- Mutes the player for the duration of Seconds (or indefinitely).
UnmutePlayer ( Player ) -- Unmutes the player if they are muted. (No, this doesn't activate their microphone, creep.)
GetDeviceInput ( Player ) -- Returns the player's AudioDeviceInput instance, if one exists.
PlayerHasVoice ( Player ) -- Returns `true` or `false` depending on whether the player has Voice Chat or not.
-- There is also an event for when a player with Voice Chat gets suspended;
VoiceStripped -- Connections fire when a player gets their Voice Chat suspended while they are in-game.
The whole module is pretty primitive but it gets the job done for those who need it.
You can get the module here, or check the source in GitHub.