Skip to main content
WEB
SkillFreeBy GameSkillGameSkill original

Web Audio SFX Synth (no audio files)

/web-audio-sfx-synth

A GameSkill original: 12 game sound effects made from code with the Web Audio API, plus the mixer around them: unlock on the first tap, a compressed master bus with mute, pitch and level variation, stereo pan, distance falloff and a voice limiter. Every sound is rendered offline and checked for clipping.

License
MIT
By
By GameSkill
Download ZIP

Tested by GameSkill

46/46 checks passed on Web Audio API in Chrome 156 headless (OfflineAudioContext + AudioContext) (2026-10-28): trigger, a runnable example, a screenshot and self-check, one job per skill, and English + Chinese docs. Trigger checks match prompts against skill descriptions; they are not a live agent run.

Test report

GameSkill's tested copy

Written and tested by GameSkill for gameskill.dev. The ZIP holds the whole skill: SKILL.md and its Chinese version, scripts, a runnable example, tests, the self-check list and our test report.

A GameSkill original, released under MIT. The ZIP keeps LICENSE and CREDITS.md, which lists the workflow inspiration, the CC0 test assets and the third-party libraries with their licenses.

Web Audio SFX Synth (no audio files)

Self-check

  • AudioContext 在用户操作里创建或恢复 / AudioContext created or resumed inside a user gesture
  • 所有声音经过同一条带压缩器的总线,静音只改总音量 / Every sound goes through one compressed master bus; mute changes only the master gain
  • 包络从 0 起音,指数衰减到 0.0001 而不是 0 / Envelopes start from silence and ramp to 0.0001, never 0
  • 同一声音有数量上限和最短间隔 / Each sound has a copy cap and a minimum gap between starts
  • 每个新配方离线渲染:峰值在 0.05 到 0.99 之间,结尾静音 / Every new recipe is rendered offline: peak between 0.05 and 0.99, silent at the end
  • npm test 和 npm run test:browser 都通过 / npm test and npm run test:browser pass

Install

Tell your AI

Install the skill from https://gameskill.dev/skills/web-audio-sfx-synth/install.md

GameSkill's tested copy

Tested copy into .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/web-audio-sfx-synth.zip -o /tmp/gameskill-web-audio-sfx-synth.zip
unzip -oq /tmp/gameskill-web-audio-sfx-synth.zip -d .claude/skills
rm /tmp/gameskill-web-audio-sfx-synth.zip

What you get

  • src/sfx.js: 12 recipes (shoot, laser, explosion, hit, jump, pickup, coin, power-up, UI click and confirm, footstep, thunder)
  • createSfx(): unlock on a user gesture, compressed master bus, mute, variation, pan and distance
  • VoiceLimiter: per-sound caps and minimum gaps, global cap, oldest copy stolen with a fade
  • validateRecipe() for your own sounds, and a soundboard page that draws every waveform
  • 12 Node tests and 20 headless Chrome checks, including an offline render of every sound

Good fit

  • Web and HTML5 games that need sound but have no audio assets
  • Fixing silent games (autoplay policy), clipping and machine-gun repetition

Not for

  • Music and adaptive soundtracks: see audio-design
  • Engine audio buses in Godot, Unity or Unreal: use the engine audio skills

Try this prompt

Prompt
Add shoot, hit, pickup and explosion sounds to my canvas game without any audio files.

About this skill

A GameSkill original, written and tested for gameskill.dev under MIT. src/sfx.js is one dependency-free file: recipes as data, maths tested in Node, and a small player that schedules Web Audio nodes. The demo is a soundboard that renders every recipe offline, draws its waveform and plays it.

Agent steps

  1. Unlock on a gesture: create or resume the AudioContext inside pointerdown / keydown.
  2. One master bus: sound gain → StereoPanner → master gain → compressor. Mute is the master gain.
  3. Recipes are data: oscillator or noise layers with a frequency sweep or notes, attack, duration, gain and an optional filter sweep. Validate new ones.
  4. Envelope: linear attack, exponential ramp to 0.0001 (never 0, never start at full gain).
  5. Variation: ±60 cents and ±1.5 dB per play, seeded.
  6. Limits: per-sound cap and minimum gap, a global cap of 24, oldest copy stolen with a fade.
  7. Space: panFor for 2D pan, distanceGain for falloff.
  8. Check every sound offline: peak between 0.05 and 0.99, no NaN, silent in the last 10 ms.

Common errors it fixes

  • No sound at all: the context was created at page load and stays suspended.
  • exponentialRampToValueAtTime throwing because it ramps to 0.
  • Clipping and harsh stacks when many copies of one sound play at once.

Credits

Ideas from the synthesised audio in Last Beacon by stackloomdev (MIT), THUNDERFALL by jackroc (CC0-1.0) and BLACKWATER by Hiraeth010 (MIT). No code was copied; recipes, code and text are ours.

Requirements

  • A browser with the Web Audio API (all current desktop and mobile browsers)
  • Node.js 20+ to run the tests; Chrome for the browser check

Topics

FAQ

Based on Last Beacon by stackloomdev (MIT). Ideas only: GameSkill wrote the code and text; CREDITS.md in the ZIP lists every source. · Based on THUNDERFALL by jackroc (CC0-1.0). Ideas only: GameSkill wrote the code and text; CREDITS.md in the ZIP lists every source. · Based on BLACKWATER by Hiraeth010 (MIT). Ideas only: GameSkill wrote the code and text; CREDITS.md in the ZIP lists every source.

Works well with

Skills the author points to as related or as the better fit for neighbouring tasks.

Similar skills