i dont really understand how the audio api thing really works so i need help
Pretty sure voice chat customization is controlled by the bubblechat customization.
I don’t know exactly how to change the volume, but maybe that helps.
Turn on UseAudioApi or something like that under VoiceChatService.
Then, make a script that connects the local player’s AudioDeviceOutput to the new player’s AudioDeviceInput using a wire whenever a new player joins.
May I just ask, what are you doing this for exactly? I don’t see any use in this, wouldn’t it annoy players more to hear a thousand voices all at the same volume? You’d barely be able to understand what the person you’re talking to is saying. It would feel like discord but worse because there are kids.
you’re right! however there can only be 4 players in one server so it’ll be fine, and you have to invite your friends so they can even join your server
i tried doing that
game.Players.PlayerAdded:Connect(function(player)
local audiodeviceoutput = Instance.new("AudioDeviceOutput") -- What the player hears
audiodeviceoutput.Name = "AudioDeviceOutput"
audiodeviceoutput.Parent = workspace
audiodeviceoutput.Player = player
local audiodeviceinput = Instance.new("AudioDeviceInput") -- What the player says
audiodeviceinput.Name = "AudioDeviceInput"
audiodeviceinput.Parent = workspace
audiodeviceinput.Player = player
for _, plr in game.Players:GetPlayers() do
if plr ~= player then
local wire1 = Instance.new("Wire")
wire1.Parent = workspace
wire1.TargetInstance = plr:WaitForChild("AudioDeviceOutput")
wire1.SourceInstance = audiodeviceinput
local wire2 = Instance.new("Wire")
wire2.Parent = workspace
wire2.TargetInstance = audiodeviceoutput
wire2.SourceInstance = plr:WaitForChild("AudioDeviceInput")
end
end
end)
and it didnt work, no clue why tho since this script that i made to hear myself worked
game.Players.PlayerAdded:Connect(function(player)
local audiodeviceoutput = Instance.new("AudioDeviceOutput")
audiodeviceoutput.Name = "AudioDeviceOutput"
audiodeviceoutput.Parent = workspace
audiodeviceoutput.Player = player
local audiodeviceinput = Instance.new("AudioDeviceInput") -- What the player says
audiodeviceinput.Name = "AudioDeviceInput"
audiodeviceinput.Parent = workspace
audiodeviceinput.Player = player
local wire = Instance.new("Wire")
wire.Parent = workspace
wire.TargetInstance = audiodeviceoutput
wire.SourceInstance = audiodeviceinput
end)
Put this code inside of a LocalScript inside of StarterPlayer.StarterPlayerScripts.
local VCS = game:GetService("VoiceChatService")
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local output = Instance.new("AudioDeviceOutput")
output.Name = "VoiceChatOutput"
output.Parent = workspace.CurrentCamera
local function createWire(newPlr: Player)
if newPlr == plr then return end -- remove this to hear yourself
if VCS:IsVoiceEnabledForUserIdAsync(newPlr.UserId) ~= true then return end
local input = newPlr:WaitForChild("AudioDeviceInput")
local wire = Instance.new("Wire")
wire.SourceInstance = input
wire.TargetInstance = output
wire.Name = newPlr.UserId
wire.Parent = output
end
Players.PlayerAdded:Connect(createWire)
for i,newPlr in pairs(Players:GetPlayers()) do
createWire(newPlr)
end
Does this work?
I tried doing this like a month ago so I already have code that works for me
yep! works perfectly fine i just had to remove
if VCS:IsVoiceEnabledForUserIdAsync(newPlr.UserId) ~= true then return end
since you cant use it on the client and i enabled “EnableDefaultVoice”
Are you sure that’s the case?
It works for me…
Or does it only work for the LocalPlayer?