Blocking VC voice

Hii! So I wan’t to have “VC” regions in my game so that people can only here other people when they are in Area 1 for example. People in Area 2 ARE NOT able to Area 1 voices. The best examples are probably: Dan's Karaoke 🎙️ - Roblox and Breaking Point - Roblox . Does anyone know how to do that?

5 Likes

You’d probably want to use the new Audio API

3 Likes

Yes, I’ve looked into it but I can’t really figure out hat to use / how to use. That’s why I made the post. :sob:

4 Likes

Yeah it doesn’t give you a listener by default so you have to use a script for it

4 Likes

What do you mean listener exactly? How would I use it / what should it do exactly?

2 Likes

You can put a script like this inside starter player scripts:

local player = game.Players.LocalPlayer

local listener = Instance.new("AudioListener")
local output = Instance.new("AudioDeviceOutput")
local wire = Instance.new("Wire")

output.Player = player

listener.Parent = camera
output.Parent = listener
wire.Parent = listener

wire.SourceInstance = listener
wire.TargetInstance = output
	
warn("Player audio listener initialized!")

This will make it so players can hear the new audio instances.

3 Likes

Well but for what do I need new audio instances? How will they block other places voice? :sob:

2 Likes

The new audio instances let you set groups for audio, so whenever a player enters a certain zone, you can set the audio group for their voice chat

1 Like

Their voice chat audio emitter is inside their character model, and then you’ll have to set the listener you created to the specific group the player is in also

1 Like

Oh okay, thank you! I’ll have a look into this once I’m home again. :slight_smile:

1 Like