Skip to content

Private Voice Channels

Guribo edited this page Jul 16, 2021 · 5 revisions

Private Voice Channels

Overview

Features

  • players in a channel can not be heard by players outside of that channel
  • (optional) players in a channel can hear players that are not in any channel
  • "unlimited" channels (more then you could ever need)
  • channels can be used by multiple, different voice override components (allows creating phones or microphones inside private rooms)

Known Limitations/Issues

  • Each player can only be in 1 channel at any point in time
  • Entering or leaving a channel takes effect delayed depending on the update rate of the BetterPlayerAudio component (more players, longer delay)
  • A player being added to a override does not prevent being added to a different override

    *Note: Walking into a private channel with a microphone that has the same priority will replace the microphone effect with the private channel effect, as will picking up a microphone inside of a room (with the same priority ) override the room effect.

To address this make sure that items that can be carried around into other zones have a higher priority so that their effects stays active.

Minimum Requirements

Components Required active count in scene/world
BetterPlayerAudio exactly 1
BetterPlayerAudioOverride at least 1

Additionally at least one component is required to add/remove players from the BetterPlayerAudioOverride component:

Available basic example components Add mechanism Remove mechanism Networking
PickupMicrophone item pickup item drop manually synchronized
VoiceOverrideZone player trigger enter player trigger exit local

Note:Alternatively you can integrate adding/removing of players to your own custom UdonSharpBehaviours.
For examples of how to do this please start by looking at the tutorial that explains the creation of the VoiceOverrideZone.

Example setup with private zones

  1. Add a single BetterPlayerAudio component to an active gameobject in your scene

    Note: Alternatively add the prefab Assets/Guribo/UdonBetterAudio/Prefabs/BetterPlayerAudio.prefab to your scene

  2. Add the prefab Assets/Guribo/UdonBetterAudio/Prefabs/Examples/VoiceOverrideTriggerZone.prefab to your scene
  3. Locate the component BetterPlayerAudioOverride on the added gameobject
  4. Drag the BetterPlayerAudio component into the inspector field called PlayerAudio
  5. Navigate to the Privacy Settings section and change the Privacy Channel Id to any other number that is not -1 to enable a private channel for this zone.
  6. (Optional) Duplicate the zone gameobject for additional zones
  7. (Optional) Change the privacy channel for each zone

    Note: Not doing this will allow players in different zones to talk to other zones with the same ID.

Scene setup with microphones

  1. Add a single BetterPlayerAudio component/prefab to your scene

    Note: only if your scene does not contain one yet!

  2. Add the prefab Assets/Guribo/UdonBetterAudio/Prefabs/Examples/PickupMicrophone.prefab to your scene
  3. Locate the component BetterPlayerAudioOverride on the added gameobject
  4. Drag the BetterPlayerAudio component into the inspector field called PlayerAudio
  5. Navigate to the Privacy Settings section and change the Privacy Channel Id to any other number that is not -1 to enable a private channel for this zone.
  6. (Optional) Duplicate the microphone gameobject for additional microphones
  7. (Optional) Change the privacy channel for each microphone to match either other zones and/or other microphones