Web Sound Event
Overview
Section titled “Overview”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.
Properties
Section titled “Properties”| Property | Type | Unit | Default | What it does |
|---|---|---|---|---|
| Signal | ComponentReference to PLCOutputBool | — | Unbound | Boolean PLC output to observe. Link the signal in the inspector. The component only reads it. |
| Edge | Rising / Falling / Both | — | Rising | Rising: false to true. Falling: true to false. Both: either change. |
| Sound | Cut / Click / Clack / Valve / Beep | — | Cut | Selects the short sound. |
| Volume | Number, 0–1 | Dimensionless | 1 | Relative level. The inspector displays 0–100% with a slider and number field. |
| MinInterval | Number, at least 0 | s, simulation time | 0.05 | Minimum simulation time between accepted sounds from this component. |
| Render | Auto / Synth | — | Auto | Auto 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.
Quick Start
Section titled “Quick Start”- 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.
- Link Signal to a PLCOutputBool, for example
xBagCutfor a knife cut. - Leave Edge = Rising, Sound = Cut and MinInterval = 0.05 s. Adjust Volume for the machine.
- 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.
- 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.
Limits
Section titled “Limits”- 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.
See Also
Section titled “See Also”- Drive Sounds — continuous actuator sounds and motor coast-down
- Signals and Logic — PLC signals in the model
- Signal Binding — linking a component’s signal slot
- Mechanism — simulation speed, pause and reset