-
Notifications
You must be signed in to change notification settings - Fork 8
PlayerAudioView
Packages/tlp.udonvoiceutils/Runtime/Core/PlayerAudio/PlayerAudioView.cs
The UI view that connects sliders and toggles to the audio configuration.
PlayerAudioView is a UdonSharp component implementing the View role in the MVC pattern (extends TLP.UdonUtils.Runtime.DesignPatterns.MVC.View).
It:
- Displays current audio settings (voice range, gain, occlusion, directionality, avatar audio) via Unity UI sliders and toggles
- Writes user changes back to the
PlayerAudioConfigurationModel(local or master, depending on ownership) - Updates automatically when the model changes (e.g. master syncs new values)
- Supports a "master control" mode where non-owner players can let the instance master control their settings
- Provides a reset-to-defaults button
| Field | Type | Purpose |
|---|---|---|
LocalConfig |
PlayerAudioConfigurationModel |
Local player's audio settings (written on slider change) |
MasterConfig |
PlayerAudioConfigurationModel |
Instance master's audio settings (written when master-controlled) |
DefaultValues |
PlayerAudioConfigurationModel |
Reset-to-defaults source |
The component exposes serialized references to Unity UI elements:
Voice Settings: SliderVoiceDistanceNear, SliderVoiceDistanceFar, SliderVoiceGain, SliderVoiceVolumetricRadius, ToggleVoiceLowpass
Avatar Settings: SliderAvatarDistanceNear, SliderAvatarDistanceFar, SliderAvatarGain, SliderAvatarVolumetricRadius, ToggleAvatarSpatialize, ToggleAvatarCustomCurve
Occlusion/Directionality: SliderOcclusionFactor, SliderPlayerOcclusionFactor, SliderListenerDirectionality, SliderPlayerDirectionality
Master Control: ToggleAllowMasterControl — lets the instance master override local settings
- When the local player changes a slider/toggle, the view writes to
LocalConfig - If the local player is the instance master, changes also write to
MasterConfig(synced to all players) - When
AllowMasterControlLocalValuesis enabled and the local player is not the master, the view displays the master's config instead - Reset restores all values from
DefaultValues
- PlayerAudioController — the controller that consumes the model
- PlayerAudioConfigurationModel — the data model holding all settings
- 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