Other players cannot hear AudioEmitter that's wired from AudioDeviceInput

Hey, first post here.

I am trying to recreate the default Roblox Voice Chat system.

As a proof of concept, I have tried to create a simple Voice Chat Script, but when I got to test it, other players cannot hear the AudioEmitter that’s wired from AudioDeviceInput. I can wire it so that the player can hear themselves, but other people cannot hear other players.

I’ve tried things like setting game.SoundService.RespectFilteringEnabled to Disabled, still no help. I have tested this on a live game, so not a Studio Issue. I have included AudioDeviceOutputs and AudioListeners in a LocalScript, so that’s not the issue.

This is the Serverside code that creates the Audio instances, borrowed from this post for proof of concept.

function connectDevices(src, target)
	local wire = Instance.new("Wire")
	wire.Parent = target
	wire.SourceInstance = src
	wire.TargetInstance = target
end

game.Players.PlayerAdded:Connect(function(player)
	
	-- Create a new AudioDeviceInput
	local micIn = Instance.new("AudioDeviceInput")
	micIn.Parent = player
	micIn.Player = player
	micIn.Muted = false
	
	-- Assign a CharacterAdded event incase the player dies and respawns
	player.CharacterAdded:Connect(function(character)
		
		-- Make a new AudioEmitter with its Parent being the Character
		local emitter = Instance.new("AudioEmitter")
		emitter.Parent = character
		
		-- Connect the devices together
		connectDevices(micIn, emitter)
		
	end)
end)

And here is the client sided code, again, borrowed from this post.

local camera = workspace.CurrentCamera
local listener = Instance.new("AudioListener")
listener.Parent = camera

local audioOut = Instance.new("AudioDeviceOutput")
audioOut.Parent = listener

local wire = Instance.new("Wire")
wire.Parent = listener

wire.SourceInstance = listener
wire.TargetInstance = audioOut

Help very much appreciated!

1 Like

Hi! Original creator of the post you linked here. Did you set VoiceChatService.UseAudioApi to Enabled? Because it is required you set that property to Enabled to use the audio API related instances.

If you were unaware and haven’t enabled it, you can enable it by inserting the VoiceChatService service and setting the service’s UseAudioApi property to Enabled. You should also set EnableDefaultVoice to false (uncheck if you’re editing the properties through Studio).

Hey thanks for your reply!

Yes, I have indeed enabled VoiceChatService.UseAudioApi. I can confirm that is not the main cause of the issue.