skills/threejs-skills/threejs-audio/SKILL.md
three.js audio spatialization: AudioListener attached to camera rig, Audio and PositionalAudio sources, AudioAnalyser for FFT/time-domain data, and integration with Web Audio API contexts; AudioLoader is referenced from threejs-loaders for file decoding. Use when placing 3D sound, configuring panner parameters, or building audio visualization; not a replacement for full game audio middleware.
npx skillsauth add partme-ai/full-stack-skills threejs-audioInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ALWAYS use this skill when the user mentions:
AudioListener on Camera, Audio vs PositionalAudio, distance models, refDistance/maxDistance/rolloffAudioAnalyser for visualization bars/spectrumIMPORTANT: audio vs loaders
| Step | Skill |
|------|--------|
| Decode mp3/ogg buffer | threejs-loaders (AudioLoader) |
| Spatial playback API | threejs-audio |
Trigger phrases include:
listener.context.state before playback; resume if suspended.refDistance, maxDistance, rolloffFactor, distanceModel per docs.AudioLoader (threejs-loaders), then positionalAudio.setBuffer.listener.context.createAnalyser() pathways per examples; watch performance.import * as THREE from 'three';
const listener = new THREE.AudioListener();
camera.add(listener);
// Validate AudioContext state before attempting playback
function ensureAudioContext() {
if (listener.context.state === 'suspended') {
listener.context.resume();
}
}
// Resume on user gesture (required by browser autoplay policy)
document.addEventListener('click', ensureAudioContext, { once: true });
const sound = new THREE.PositionalAudio(listener);
const loader = new THREE.AudioLoader();
loader.load('sound.mp3', (buffer) => {
sound.setBuffer(buffer);
sound.setRefDistance(20);
sound.setRolloffFactor(1);
});
mesh.add(sound); // Attach to a scene object for spatial positioning
See examples/workflow-positional-audio.md.
| Docs section | Representative links | |--------------|----------------------| | Audio | https://threejs.org/docs/AudioListener.html | | Audio | https://threejs.org/docs/Audio.html | | Audio | https://threejs.org/docs/PositionalAudio.html | | Audio | https://threejs.org/docs/AudioAnalyser.html |
Extended list: references/official-sections.md.
Audio classes are under Audio in three.js docs. Decoding buffers uses AudioLoader—see threejs-loaders. Browser Web Audio policies are external but must be mentioned when AudioContext is suspended.
When answering under this skill, prefer responses that:
AudioListener, PositionalAudio, or AudioAnalyser as relevant.AudioLoader).English: audio, positional audio, listener, analyser, spatial sound, web audio, three.js
中文: 音频、空间音频、AudioListener、PositionalAudio、Web Audio、three.js
development
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.