Skip to content

Tutorial #3 Setting up world audio

Guribo edited this page Jul 5, 2026 · 4 revisions

Tutorial #3: Setting Up World Audio

Overview

This tutorial walks through adding managed AudioSources to your scene using the WorldAudio system. WorldAudio provides importance-based culling, reverb, and privacy channel gating for scene audio (music, ambient, sound effects).

You will learn how to:

  1. Add the WorldAudioController to your scene
  2. Create a managed AudioSource with OccludedEmitter
  3. Configure spatial audio for VRChat
  4. Test the setup

Prerequisites

  • Installation complete
  • TLP_Essentials prefab in your scene
  • TLP_PlayerAudioController prefab in your scene
  • Basic Unity knowledge

1. Add WorldAudioController

  1. Drag the TLP_WorldAudioController prefab into your scene:

    • Path: Packages/tlp.udonvoiceutils/Runtime/Prefabs/Core/TLP_WorldAudioController.prefab
    • This is the core controller that drives the emitter update loop
  2. Select the TLP_WorldAudioController in hierarchy

  3. Verify the WorldAudioController component is present in the Inspector

Note: Only one WorldAudioController is allowed per scene.


2. Create a Managed AudioSource

  1. Create a new empty GameObject (name it e.g. AmbientMusic)
  2. Add an AudioSource component
  3. Assign your audio clip to the AudioSource
  4. Configure basic AudioSource settings:
    • Spatialize: ✅ enabled (required for VRChat 3D audio)
    • Loop: ✅ enabled (for ambient/music)
    • Play On Awake: ✅ enabled (starts automatically)
    • Max Distance: set based on your needs (e.g. 50)

3. Add OccludedEmitter

  1. Add an OccludedEmitter component to the same GameObject

  2. The following components are added automatically:

    • ReverbController — manages reverb and lowpass filter
    • AudioLowPassFilter — distance-based muffling
    • AudioReverbFilter — reverb effect
  3. Configure OccludedEmitter settings:

    • Disable GameObject When Culled: ✅ enabled (saves CPU when culled)
      • ⚠️ Set to false for Unity VideoPlayer sources — disabling breaks audio filters
    • Privacy Channel Id: -1 (no privacy, audible to all)

4. Add VRCSpatialAudioSource

VRChat requires the VRCSpatialAudioSource component for proper 3D spatialization:

  1. Add VRCSpatialAudioSource component to the same GameObject
  2. Configure settings:
    • Enable Spatialization: ✅ enabled
    • Gain: 0 (default, no volume boost)
    • Far: 40 (distance where audio becomes inaudible)
    • Near: 5 (distance where audio is at full volume)
    • Volumetric Radius: 5 (range where audio is not spatialized)

5. Final GameObject Structure

AmbientMusic
├─ AudioSource (Spatialize: true, Loop: true)
├─ AudioLowPassFilter
├─ AudioReverbFilter
├─ OccludedEmitter
├─ ReverbController
└─ VRCSpatialAudioSource

6. Configure WorldAudioController (Optional)

Select the TLP_WorldAudioController and adjust if needed:

Field Default Description
Importance Updates Per Frame 1 Emitters to recalculate importance for per frame. Higher = more responsive, more CPU
Updates Per Frame 3 Emitters to update per frame. Higher = more responsive, more CPU
Max Active Sources 32 Max concurrent active emitters. Beyond this, lowest-importance emitters are culled

7. Test

  1. Enable ClientSim
  2. Click Play
  3. Walk toward the AudioSource — audio should be clear and loud
  4. Walk away — audio should fade with distance
  5. Walk beyond Max Distance — audio should be inaudible

How It Works

The WorldAudio system manages your AudioSource through the emitter lifecycle:

  1. Startup — OccludedEmitter registers with the EmitterRegistry
  2. Importance scoring — each frame, WorldAudioController recalculates importance based on distance, volume, and priority
  3. Culling — when beyond MaxActiveSources, lowest-importance emitters are suspended
  4. Reverb/lowpass — distance-based audio effects applied automatically
  5. Reactivation — when a culled emitter becomes important again, it resumes seamlessly

See WorldAudio-Subsystem for full details.


Adding More Emitters

Repeat steps 2-4 for each AudioSource you want managed:

  • Ambient music
  • Sound effects
  • Environmental audio
  • Video player audio (set Disable GameObject When Culled to false)

See Also

Clone this wiki locally