Issues with Voice Chat | Unable to use it in while testing in Roblox studio

  1. “What do you want to achieve?”
    I want to be able to test voice chat in Roblox Studio

  2. “What is the issue?”
    Voice chat doesn’t work. My voice doesn’t register.

  3. “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.

1 Like

From my own testing, voice chat seems to work fine in test mode. I used a voice analyzer to print out the RmsLevel and everything seemed to function fine. One thing to note is that the voice activity indicator does not seem to function in test mode even though your voice is being transmitted.
Could you further explain your situation?