Log inGet started
Package

components.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

ecs.AudioListener

Spec for the AudioListener component, which maps to the native AudioListener. The entity carrying it is the "ears" of the scene: its transform sets where spatial audio is heard from. Attach it to whatever should hear — a camera, a character, a listener rig.

Fields

  • active — whether this listener drives the ears. It is live: writing it takes effect on the next frame, so clearing it on the listener holding the ears hands them to another active listener, and clearing it everywhere leaves spatial sources playing centered. When several are active one of them drives the ears — the same one every frame — and audio.observe().listener.entity names it.
entity(id).component.add("AudioListener", { active = true })