Skip to content

WorldAudioController

Guribo edited this page Jul 11, 2026 · 2 revisions

WorldAudioController

Packages/tlp.udonvoiceutils/Runtime/Core/WorldAudio/WorldAudioController.cs

Core controller driving the importance-based emitter update loop.

Overview

WorldAudioController is the entry point for the WorldAudio subsystem. Each frame it:

  1. Rebuilds the emitter registry if changed
  2. Recalculates importance for a subset of emitters
  3. Updates a subset of emitters (privacy check, occlusion, culling, reverb)

Only one allowed per scene. Reads configuration from PlayerAudioController.

Configuration

Field Default Range Description
ImportanceUpdatesPerFrame 1 1–100 Emitters to recalculate importance for per frame. Higher = more responsive, more CPU
UpdatesPerFrame 3 1–100 Emitters to update (apply effects) per frame. Higher = more responsive, more CPU
MaxActiveSources 32 Max concurrent active emitters. Beyond this, lowest-importance emitters are culled

Dependencies

Field Type Purpose
ImportanceTree AvlTree AVL tree for importance-based sorting
PlayerAudioController PlayerAudioController Reads occlusion config and local override from this. Resolved at runtime via VoiceUtils.FindPlayerAudioController()
PartitionState PartitionState Partition configuration
PartitionCursor PartitionCursor Round-robin iteration state
EmitterRegistry EmitterRegistry Tracks active emitters

Behavior

  • Runs in PostLateUpdate (after all other audio processing)
  • When EmitterRegistry.NeedsRebuild is true, rebuilds partitions and scheduler
  • Recalculates importance for ImportanceUpdatesPerFrame emitters per frame
  • Updates UpdatesPerFrame emitters per frame (privacy, occlusion, culling, reverb)

Important Limitation

Do not directly control this component. It is managed by the WorldAudio system.

Related

Clone this wiki locally