threejs-audio-generator
majidmanzarpour/threejs-game-skills
Generate, convert, and integrate game audio for Three.js with ElevenLabs—SFX, music, voice, and Web Audio playback.
What is threejs-audio-generator?
Skill for creating and processing audio assets for Three.js browser games using ElevenLabs API. Generates sound effects, music loops, ambience, and text-to-speech dialogue; converts and cleans voice recordings; and integrates audio into games via Web Audio with manifests, looping, and volume groups.
- Generate sound effects, ambience, and music loops via ElevenLabs API with prompt-based control
- Create text-to-speech dialogue and announcer lines with voice selection
- Convert and clean voice recordings from scratch performances or noisy sources
- Isolate speech and remove background noise from source audio
- Build audio manifests and integrate playback into Three.js games with Web Audio API
- Support looping, volume groups, pause/resume, and gesture-based unlock for browser audio
How to install threejs-audio-generator
npx skills add https://github.com/majidmanzarpour/threejs-game-skills --skill threejs-audio-generator- ElevenLabs API key (set via ELEVENLABS_API_KEY environment variable or --api-key flag)
- Python 3 installed and accessible
- Three.js game project with an assets directory structure
How to use threejs-audio-generator
- 1.Set your ElevenLabs API key in the environment: export ELEVENLABS_API_KEY=your_key_here
- 2.Run probe to verify credentials: python3 <skill-dir>/scripts/threejs_audio_asset.py probe
- 3.Generate SFX with: python3 <skill-dir>/scripts/threejs_audio_asset.py sfx --prompt "description" --duration 1.2 --out assets/audio/sfx/name.mp3
- 4.Generate music loops with: python3 <skill-dir>/scripts/threejs_audio_asset.py music --prompt "description" --duration 60 --instrumental --out assets/audio/music/name.mp3
- 5.Generate dialogue with: python3 <skill-dir>/scripts/threejs_audio_asset.py tts --text "line" --voice-id ID --out assets/audio/voice/name.mp3
- 6.Clean or convert voice with: python3 <skill-dir>/scripts/threejs_audio_asset.py voice-change --input source.wav --voice-id ID --remove-background-noise --out output.mp3
- 7.Integrate generated audio into your game using Web Audio API with the provided manifest structure and runtime integration patterns
Use cases
- Create a full SFX and music suite for a browser-based game without external audio tools
- Generate UI click sounds, weapon impacts, and creature stingers on-demand
- Convert a voice actor's scratch recording to match a specific character voice while preserving timing
- Clean up noisy dialogue or ambience recordings before final integration
- Build layered music tracks (menu, gameplay, boss themes, victory/defeat stingers) with looping support
- Game developers building Three.js browser games
- Indie game teams without dedicated audio engineers or budgets for external audio production
- Developers needing rapid iteration on sound design and voice work
- Projects requiring text-to-speech for announcer or tutorial dialogue
threejs-audio-generator FAQ
No. Follow your project's asset policy; do not commit or publish generated audio unless explicitly asked. Keep outputs locally for testing and QA.
Use --validate to confirm the key works (prints VALID_USER). If it passes, the failure is likely due to credit exhaustion or plan limits, which surface as HTTP 4xx errors. Check your ElevenLabs account status.
Yes. Record a scratch performance with the correct timing and acting, then use voice-change with --remove-background-noise to convert it to your target voice while preserving the original performance.
Use --loop flag when generating ambience or music (e.g., --duration 12 --loop). For music, the reference guide covers looping strategy, layering, and loop-point handling via Web Audio.
Default is mp3_44100_128 (44.1 kHz, 128 kbps). Refer to references/audio-workflows.md for format options, duration ranges, and prompt-influence settings for different audio types.
Full instructions (SKILL.md)
Source of truth, from majidmanzarpour/threejs-game-skills.
name: threejs-audio-generator description: "Generate, convert, clean, and integrate audio for Three.js browser games with ElevenLabs: sound effects, looping ambience, music tracks and loops (menu, gameplay, boss, victory/defeat stingers), UI sounds, impact/weapon/vehicle audio, creature and boss stingers, announcer and dialogue TTS, voice conversion from a scratch performance, voice cleanup, audio manifests, and Web Audio integration."
Three.js Audio Generator
Game-ready audio for Three.js projects: SFX, music, voice work, cleanup, and runtime integration. Provider: ElevenLabs.
Resolve <this-skill-dir> from the actual loaded skill file. Resolve sibling skills beside it first, then use the runner's discovered paths. Do not mix installed versions or assume a particular home directory.
Reference
references/audio-workflows.md — the audio matrix, prompt patterns, generation, music, and voice strategy, Web Audio manager shape, and runtime failure modes. Read it before planning a game's audio, generating a batch, wiring runtime playback, or converting voices.
When to use
SFX (jumps, hits, weapons, explosions, pickups, collisions, UI clicks) · music (menu and gameplay loops, boss themes, intensity layers, win/lose stingers) · ambience (wind, rain, city bed, engine hum, room tone, arena beds) · voice (announcer barks, boss lines, tutorial prompts, menu narration) · voice conversion from a scratch performance when timing and acting matter · cleanup and isolation before conversion or final use · Web Audio integration with loading, looping, manifests, volume groups, pause/resume, and gesture unlock.
Audio is not cosmetic for a premium game. Build an audio matrix from the events the game actually has; do not add dialogue, weapons, music, or ambience layers just to fill categories. Respect explicit silent, procedural-audio, accessibility, and external-service constraints. A narrow sound fix does not need a new soundtrack.
API key
The script reads --api-key or ELEVENLABS_API_KEY. Keys never go in skill files, game code, or reports.
python3 <this-skill-dir>/scripts/threejs_audio_asset.py probe # ELEVENLABS_API_KEY=SET|MISSING
Keys defined only in a shell profile can be absent from the process env; threejs-game-director/scripts/probe_asset_credentials.sh sources the profile and probes all three providers.
Add --validate to call GET /user and confirm the key actually works (prints VALID_USER=...) when a key is present but generation fails. A valid key can still be blocked by credit or plan limits, which surface as an HTTP 4xx from a real generation attempt — report that as a plan blocker rather than a missing key.
Commands
Run from the game project directory:
python3 <this-skill-dir>/scripts/threejs_audio_asset.py sfx \
--prompt "tight futuristic boost pickup, bright transient, short sparkling tail, arcade racing game" \
--duration 1.2 --prompt-influence 0.65 --out assets/audio/sfx/boost-pickup.mp3
python3 <this-skill-dir>/scripts/threejs_audio_asset.py sfx \
--prompt "seamless cyber resort ambience, distant surf, soft neon transformer hum, gentle crowd bed" \
--duration 12 --loop --prompt-influence 0.45 --out assets/audio/ambience/cyber-resort-loop.mp3
python3 <this-skill-dir>/scripts/threejs_audio_asset.py music \
--prompt "driving synthwave race loop, 128 BPM, punchy analog bass, bright arpeggios, steady energy with no intro or fade-out, designed to loop" \
--duration 60 --instrumental --out assets/audio/music/race-loop.mp3
python3 <this-skill-dir>/scripts/threejs_audio_asset.py tts \
--text "Perfect shot." --voice-id JBFqnCBsd6RMkjVDRZzb --out assets/audio/voice/perfect-shot.mp3
python3 <this-skill-dir>/scripts/threejs_audio_asset.py isolate \
--input assets/audio/source/noisy-boss-line.wav --out assets/audio/voice/boss-line-clean.mp3
python3 <this-skill-dir>/scripts/threejs_audio_asset.py voice-change \
--input assets/audio/source/scratch-boss-line.wav --voice-id JBFqnCBsd6RMkjVDRZzb \
--remove-background-noise --out assets/audio/voice/boss-line-final.mp3
Defaults
- SFX:
mp3_44100_128, 0.5–2.5s, prompt influence 0.55–0.8. - UI: 0.15–0.8s, high prompt influence, transients kept clear.
- Ambience: 8–30s with
--loop, prompt influence 0.3–0.55. - Music:
music --prompt(--duration3–600s,--instrumental) or--plan FILEwith acomposition_planJSON for sectioned tracks (--seedworks only with plans). The API has no loop flag; lengths, looping, and layering are in the reference's Music Strategy. - Voice: TTS for clean generated lines;
voice-changewhen timing and acting from a scratch performance matter. Isolate noisy speech first. - Runtime: generate into the game project and load through Web Audio. Follow the project's asset/version-control policy; do not commit or publish unless asked. No API keys in browser code.
Recovery and Coordination
For coordinated games use the director's references/asset-recovery.md. Preserve outputs and the audio trigger mapping before retrying work. Distinguish missing credentials, permissions, exhausted credits, invalid input, and transient service failures. Reconcile an uncertain paid request before resubmitting; these one-shot commands do not implement Tripo task resume. Keep independent gameplay work moving and provide a local/synthesized fallback with honest limitations when genuinely blocked.
Listen to a representative effect or line before generating a batch. Test it through its real game event, then give the lead paths and local playback findings for one consolidated QA pass.
Report
Generated and processed file paths, the prompts, composition plans, text, source files, voice IDs, durations, loop flags and loop points and formats behind them, the runtime trigger mapping and audio groups, and any remaining gaps or plan limits.
Related skills
More from majidmanzarpour/threejs-game-skills and the wider catalog.

threejs-debug-profiler
Debug and profile Three.js games: render bugs, asset loading, performance bottlenecks, and bundle size.

threejs-game-director
Orchestrate end-to-end Three.js browser game development from prototype to release.

threejs-game-ui-designer
Design premium Three.js game UI: HUDs, menus, overlays, and responsive layouts for any genre.

threejs-gameplay-systems
Build playable Three.js game systems with design briefs, core loops, physics, and tuning for browser games.

threejs-image-generator
Generate and edit 2D game assets for Three.js with Google's Gemini image API.

threejs-qa-release
QA and release verification for Three.js browser games with automated testing, visual regression, and risk reporting.