As a Roblox developer, it is currently too hard to …
switch the Input Device for the Microphone in Roblox Studio when launching a playtest, through the ESC Settings Menu.
If this issue is addressed, it would improve my development experience because …
It would allow comfortable switching through different microphone devices, useful for testing.
(No Input Device option is present)
Current way to change a mic is through SoundService
, but that’s a RobloxSecurity thing.
Code
function iter2(a, i)
i = i + 1
local v = a[1][i]
local v2 = a[2][i]
if v or v2 then
return i, v, v2
end
end
local function ipairsDouble(tbl1, tbl2)
local merged = {tbl1, tbl2}
return iter2, merged, 0
end
local SoundService = game:GetService("SoundService")
local function get_devices_in_an_understandable_format()
local tbl_deviceNames, tbl_guids = game:GetService("SoundService"):GetInputDevices()
local out = {}
for k, v, v2 in ipairsDouble(tbl_deviceNames, tbl_guids) do
table.insert(out, {
name = v,
guid = v2
})
end
return out :: {
[number]: {
name: string,
guid: string
}
}
end
local inputDevices = get_devices_in_an_understandable_format()
local selectedDevice = inputDevices[1]
local deviceBefore = SoundService:GetInputDevice()
SoundService:SetInputDevice(selectedDevice.name, selectedDevice.guid)
-- Did the device actually change?
if (deviceBefore == SoundService:GetInputDevice()) then
warn("The device didn't change, if you were trying to change it.")
warn("Current Device:", SoundService:GetInputDevice())
else
print("New Device:", SoundService:GetInputDevice())
end
Not sure if it’s called like that, but there’s a function called updateAudioDevices
. That only gets ran if game:GetEngineFeature("EnableCrossExpVoice")
returns true and if a CrossExperienceVoiceManager
is “connected”.
There’s two of these updateAudioDevices
, one for the Input and one for the Output. And only the output is not in those “if” closures.
So, the Input Device setting, is gated through that
I think at least.
Not, sure how I’d force enable this game:GetEngineFeature("EnableCrossExpVoice")
but, it’s pretty much one of the things that seems to gate the Input Device setting from showing up in there, I think.
Once it used to appear in the settings, but now it doesn’t anymore. Give us the ability to better test Voice Chat API - #4 by ReallyLongArms