-
“What do you want to achieve?”
I want to be able to test voice chat in Roblox Studio -
“What is the issue?”
Voice chat doesn’t work. My voice doesn’t register. -
“What solutions have you tried so far?”
a) I have manually enabled the “UseAudioApi” in voice chat service to true.
b) I have set the “AcessType” property in AudioDeviceInput inside the player to Allow upon joining the game if game is running in studio.
I have looked all around devforum, but i didn’t find any possible solutions for this problem.
[[ code ]]
local Players = game:GetService("Players")
local VoiceChatService = game:GetService("VoiceChatService")
local RunService = game:GetService("RunService")
Players.PlayerAdded:Connect(function(player)
if RunService:IsStudio() then
local AudioDeviceInput = player:WaitForChild("AudioDeviceInput", 35)
print(AudioDeviceInput.AccessType)
if AudioDeviceInput.AccessType ~= Enum.AccessModifierType.Allow then
AudioDeviceInput.AccessType = Enum.AccessModifierType.Allow
print("access ~= allow, changing")
print(AudioDeviceInput.AccessType)
end
local success, isEnabled = pcall(function()
return VoiceChatService:IsVoiceEnabledForUserIdAsync(player.UserId)
end)
if success then
if not isEnabled then
player:Kick()
end
else
print("fail", player.UserId)
end
else
return
end
end)
Output: [
09:54:25.114 Enum.AccessModifierType.Deny - Server - Script:6
09:54:25.114 access ~= allow, changing - Server - Script:10
09:54:25.114 Enum.AccessModifierType.Allow - Server - Script:11
09:54:25.342 fail 2015947925 - Server - Script:23
]
Voice chat does work in the published version of the game after disabling the script.
Voice chat ui is visible inside the game while testing.