@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / AudioSystem
Class: AudioSystem ​
Defined in: systems/AudioSystem.ts:46
Reconciles AudioComponent state with the underlying THREE.js audio objects each frame.
Playback — drives play(), pause(), and stop() on the THREE.js audio node based on the isPlaying / isPaused flags set by AudioComponent.play(), .pause(), and .stop().
Option sync — detects changes to loop, pitch, volume, refDistance, distanceModel, and rolloffFactor and applies them live. Changes take effect on the next frame, so scripts and inspector edits during runtime are reflected without reloading the scene.
Only active in preview mode (isEditor: true makes every update a no-op so the editor is unaffected).
Implements ​
Constructors ​
Constructor ​
new AudioSystem(__namedParameters?): AudioSystem;Defined in: systems/AudioSystem.ts:55
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | { isEditor?: boolean; } |
__namedParameters.isEditor? | boolean |
Returns ​
AudioSystem
Methods ​
update() ​
update(world, _deltaTime): void;Defined in: systems/AudioSystem.ts:59
Parameters ​
| Parameter | Type |
|---|---|
world | World |
_deltaTime | number |
Returns ​
void
Implementation of ​
dispose() ​
dispose(_world): void;Defined in: systems/AudioSystem.ts:180
Parameters ​
| Parameter | Type |
|---|---|
_world | World |
Returns ​
void

