Skip to main content

Function: createAudioEcsSystem()

createAudioEcsSystem(): EcsSystem<[AudioEcsComponent]>

Defined in: audio/systems/audio-system.ts:13

Creates an ECS system to handle audio playback.

Each tick, entities with an AudioEcsComponent whose playSound is true have sound.play() called and playSound reset to false. When the world stops, any matching entity whose sound is still playing has it stopped and unloaded.

Returns

EcsSystem<[AudioEcsComponent]>

An ECS system that manages audio playback for entities with AudioEcsComponent.