Skip to content

Web Sound Event

A WebSoundEvent component plays a short sound at its node when a boolean PLC output changes. Use it for a knife cut, a stamping action, a valve or a confirmation beep. It works on any node and does not require a Drive.

In Unity this is a UI-only marker for realvirtual 3D-HMI. No Unity runtime function. Export the marker and its linked signal together in the GLB; the browser plays the sound.

PropertyTypeUnitDefaultWhat it does
SignalComponentReference to PLCOutputBool—UnboundBoolean PLC output to observe. Link the signal in the inspector. The component only reads it.
EdgeRising / Falling / Both—RisingRising: false to true. Falling: true to false. Both: either change.
SoundCut / Click / Clack / Valve / Beep—CutSelects the short sound.
VolumeNumber, 0–1Dimensionless1Relative level. The inspector displays 0–100% with a slider and number field.
MinIntervalNumber, at least 0s, simulation time0.05Minimum simulation time between accepted sounds from this component.
RenderAuto / Synth—AutoAuto uses a recorded event clip when available and synthesis otherwise. Synth always synthesises.

The inspector provides a signal slot, selectors for Edge, Sound and Render, volume controls, a MinInterval number field in seconds and a Preview button.

  1. Add WebSoundEvent to the part that should emit the sound, such as the knife node. In Unity choose realvirtual → WebHMI → Web Sound Event and export the node and signal together.
  2. Link Signal to a PLCOutputBool, for example xBagCut for a knife cut.
  3. Leave Edge = Rising, Sound = Cut and MinInterval = 0.05 s. Adjust Volume for the machine.
  4. In the viewer, click the speaker button in the view controls to enable sound. It appears in a scene with a Sound or WebSoundEvent component.
  5. Run the simulation. Each matching edge within the interval and voice budget plays at the part’s position. In the Editor, Preview plays once even while the global sound switch is off.

Browsers require a click or key press before playing audio. Preview uses the component’s Sound, Volume and Render settings and does not need a signal edge.

  • Only edges that reach the signal store can trigger sound. A short pulse may be lost or coalesced by a controller, transport or input buffer before the viewer receives it. The component observes store changes rather than polling once per rendered frame; it cannot reconstruct missing transitions.
  • MinInterval uses simulation time. Pause stops this clock, and the simulation speed factor changes how quickly it advances. Reset clears the interval limiter. Edges rejected by the interval or the shared one-shot pool and fast-factor queue budget are dropped.
  • Sound must be enabled and the simulation running. An unbound or invalid Signal stays silent and appears in Problems. Binding a signal, resetting or synchronising after reconnect establishes the current level without treating that snapshot as a new edge.
  • The sound list is fixed: Cut is a metallic snip, Click a short click, Clack a hard mechanical knock, Valve a valve tick, and Beep a short tone. These are brief event sounds, not continuous drive sounds or custom audio-file uploads.
  • Synthesis and clips: all five sounds have synthesised voices. Auto can use matching recorded event clips when a viewer’s library provides them; it falls back to synthesis while clips are missing or loading. Synth always uses the synthesised voice. Event clips are not required for the component to work.
  • Position: the sound originates at the node when the edge occurs and becomes quieter with distance. A queued event keeps that position.