-
Notifications
You must be signed in to change notification settings - Fork 8
AudioSourceStateController
Packages/tlp.udonvoiceutils/Runtime/Core/WorldAudio/AudioSourceStateController.cs
Manages AudioSource play/pause/stop state and handles culling suspension.
AudioSourceStateController manages the lifecycle of a single AudioSource. It provides:
- Play/Pause/Stop — standard playback control
- Culling — suspends playback when the emitter is culled by the importance system
- Position tracking — preserves logical playback position during culling for seamless resume
Part of the WorldAudio subsystem. One per OccludedEmitter. Automatically called during emitter updates — world creators do not interact with this component directly.
When an emitter is culled (beyond max active sources or privacy-gated):
- Playback is suspended and the current position is saved
- The actual
AudioSourceis stopped - Logical playback position is computed from elapsed time on resume
- When the emitter becomes active again, playback resumes from the correct position
If the clip length changes during culling, playback restarts from the beginning.
Do not directly control the AudioSource (Play/Pause/Stop) when it is managed by the WorldAudio system. All control must go through this component. Direct manipulation conflicts with culling and importance sorting.
- OccludedEmitter — triggers culling and reactivation
- ReverbController — manages audio effects on the same AudioSource
- WorldAudioController — drives the update loop that triggers culling
- Architecture
- Occlusion
- Voice Directionality
- Height Scaling
- Audio Processing Pipeline
- Private Voice Channels
- WorldAudio Subsystem
- WorldAudio Limitations
- Set Up Occlusion
- Set Up Voice Channels
- Set Up Reverb
- Set Up Height Scaling
- Set Up Voice Directionality
- Set Up Microphone
- Set Up WorldAudio Emitters
- Enable Debug Mode
- Tutorial #1: Custom Voice Override Zone
- Tutorial #2: Private Voice Channels
- Tutorial #3: Setting Up World Audio
- PlayerAudioController
- PlayerAudioOverride
- PlayerAudioOverrideList
- PlayerAudioView
- PlayerAudioConfigurationModel
- SyncedPlayerAudioConfigurationModel
- VoiceUtils
- IgnoredPlayers
- AudioObstacle
- DefaultPlayerOcclusion
- NullPlayerOcclusion
- PlayerOcclusionStrategy
- Privacy Channel Reference
- AdjustableGain
- DynamicPrivacy
- PickupMicrophone — MVC microphone system with MicModel/MicController/MicView
- VoiceOverrideTriggerZone
- VoiceOverrideRoom