Search Unity

Discussion Private Voice/Sound Rooms - Udon - VRC

Discussion in 'Audio & Video' started by Keaters, Dec 3, 2022.

  1. Keaters

    Keaters

    Joined:
    Nov 28, 2022
    Posts:
    3
    Is it possible to create privatized areas within game where when a player is outside the bounds of an objects collision they cannot hear or speak to anyone within the bounds and as soon as they enter they can hear and speak? (WITH 3D Spatial Sound).

    In Example :
    VRChat_2022-12-03_03-13-31.120_1920x1080.png When Player-Left and Player-Right are within the bounds of the boxes collision, they can speak to and hear each other just fine, but I, outside of the bounds, cannot Speak to or hear them.

    VRChat_2022-12-03_03-14-16.342_1920x1080.png But when Player-Left steps out of the bounds, They can no longer speak to or hear Player-Right, but I can now speak to and hear Player-Left from where I am positioned outside the bounds.

    I suppose (In a rough idea) a potential way of going about this could be to :

    > Set a collider on an object (with the size set to the bounds of the area in which we are trying to effect)
    > Set Is Trigger to True
    > Then some C-Script/Udon Nodes that will have been compiling a list of players that are in the world
    > reading if there are any players within the bounds or not
    > setting their values to if they are in the bounds or not
    > Then when a player enters, have it read the players unique ID somehow (maybe each player gets a unique number for when they join the instance) and add them to the list of players within the bounds
    > Set their voice and/or avatars volume + ability to hear others within the cube who are also on the list to On
    > Then the opposite when they leave.

    + I suppose the best thing would be to only mess with the voices parameters if possible to avoid cutting out world sounds.

    (I've tried a few different paths with Udon and C-Script, but all ive found so far has just been voice radial settings within the bounds (that can still sort of be heard outside the bounds), rather than an a true private audio zone)

    Open to hearing your thoughts/viewpoints.
     
    Last edited: Dec 3, 2022
  2. Keaters

    Keaters

    Joined:
    Nov 28, 2022
    Posts:
    3
  3. Keaters

    Keaters

    Joined:
    Nov 28, 2022
    Posts:
    3