cesartevisual/threejs-skills

threejs-audio

Add Three.js spatial audio, user-controlled playback, listener movement, and audio lifecycle handling.

Zobacz źródło

Jak używać

  1. Skopiuj polecenie instalacji i sprawdź źródła przed instalacją we własnym środowisku agenta.
  2. W oryginale sprawdź wymagane narzędzia, dane dostępowe i obsługiwane środowiska.
  3. Opisz dane wejściowe i oczekiwany rezultat; porównaj wynik ze źródłami.
npx skills add https://github.com/cesartevisual/threejs-skills --skill threejs-audio

Przed rozpoczęciem

  • Instalacja nie obejmuje subskrypcji modelu, limitu API ani uprawnień do plików.
  • Gwiazdki i instalacje pokazują aktywność, a nie niezależny test jakości lub bezpieczeństwa.
Oryginalny dokument Skill

Treść z repozytorium z zachowaniem nagłówków, przykładów, kodu, tabel, linków i obrazów.

Spatial Audio

Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.

Establish whether audio communicates information or provides optional ambience. Expose mute/volume and any required textual equivalent in HTML. Start or resume audio from a user interaction and handle autoplay rejection without breaking the scene.

Attach the listener to the active viewpoint and handle camera changes without duplicating listeners or output paths. For positional sources, choose distance/rolloff and directional cones in the scene's units. A positional source does not automatically simulate wall occlusion.

Load and decode asynchronously with explicit failure and stale-result handling. Bound concurrent sources and reuse buffers where appropriate. Avoid replaying a sound on every frame of a collision; trigger from meaningful state transitions.

Coordinate pause, visibility changes, route transitions, and XR session transitions with playback. Stop/disconnect owned sources and release listeners. Do not close an AudioContext shared with another part of the application.

Verify blocked autoplay, first interaction, mute persistence, moving-camera attenuation, rapid retriggers, and repeated mount/unmount. Measure perceived volume on actual output devices when spatial audio matters.

API reference

Consult the official documentation for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.

Powiązane zadania

z tego samego repozytorium

Więcej Skills

Wszystkie Skills