Skip to content

PlayerAudioOverrideList

Guribo edited this page Jul 3, 2026 · 3 revisions

PlayerAudioOverrideList

Packages/tlp.udonvoiceutils/Runtime/Core/PlayerAudioOverrideList.cs

The sorted list of PlayerAudioOverrides a single player is currently affected by.

Overview

The UdonSharpbehaviour PlayerAudioOverrideList is the component which

  • is used by the PlayerAudioController to determine which override to apply to a player
  • contains all overrides a single player is currently affected by
  • is always sorted by PlayerAudioOverride.Priority
    • highest priority override (or last added with same priority) is at the first position in the list
  • automatically removes invalid entries when accessed
  • contains no duplicates

Public API

Method Returns Description
AddOverride(PlayerAudioOverride) bool Add an override, maintaining priority sort order
RemoveOverride(PlayerAudioOverride) int Remove an override, returns remaining count
GetMaxPriority(VRCPlayerApi, out PlayerAudioOverride) bool Get the highest-priority override not blacklisting the player
Get(int index) PlayerAudioOverride Get override at index (consolidates invalid entries first)
Overrides int Number of valid overrides in the list

Behavior

  • When AddOverride is called, the override is inserted at the correct position based on priority
  • When Get or GetMaxPriority is called, invalid (destroyed) entries are automatically consolidated
  • RemoveOverride compacts the array and returns the new count

Related

Clone this wiki locally