webaudio-guide

webaudio-guide is a skill for Claude Code, Codex from kunitoki/sonic-skills. It costs 98 tokens per session (913 once invoked), scanned A, original, Unlicense.

A step-by-step guide to building Web Audio pipelines, which process sound in a web browser.

In plain words
What is it for?
It is for creating AudioWorklet processors, custom audio effects, automated parameters, custom nodes, and WebMIDI connections.
Why use it?
It explains the setup and implementation details that can make browser audio features difficult to build correctly, including AudioWorklet and MIDI integration.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kunitoki/sonic-skills/webaudio-guide
Any agent
npx skills add kunitoki/sonic-skills --skill webaudio-guide
Clone the repo
git clone --depth 1 https://github.com/kunitoki/sonic-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for webaudio-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/kunitoki/sonic-skills/webaudio-guide.svg)](https://agentmods.dev/skills/kunitoki/sonic-skills/webaudio-guide)
Your own site
<a href="https://agentmods.dev/skills/kunitoki/sonic-skills/webaudio-guide"><img src="https://agentmods.dev/badge/skills/kunitoki/sonic-skills/webaudio-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 913 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00098 $0.00913
Opus 5 $0.00049 $0.00456
Sonnet 5 $0.00020 $0.00183
Haiku 4.5 $0.00010 $0.00091

Measured 4d ago against content hash 38c9985fca1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

webaudio-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/webaudio-guide/SKILL.md · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Web Audio Processing Guide

Step 1 — Set up AudioContext and load worklet module

  • Create AudioContext inside a user gesture handler (click, keydown) to satisfy autoplay policy.
  • Call await audioContext.audioWorklet.addModule('path/to/processor.js') before creating nodes.
  • The module path is resolved relative to the page; bundlers may require special config (e.g. Vite's ?worker&url import).
  • Check audioContext.state and call audioContext.resume() if it is 'suspended'.

Step 2 — Write the AudioWorkletProcessor

  • Subclass AudioWorkletProcessor in a separate file; call registerProcessor('name', Class) at module scope.
  • Implement process(inputs, outputs, parameters)inputs[n][channel] and outputs[n][channel] are Float32Array views for the current render quantum. Use .length in loops instead of hardcoding 128.
  • Pre-allocate all working buffers in constructor(); never create objects or arrays inside process().
  • Declare custom AudioParams via static get parameterDescriptors() returning an array of { name, defaultValue, minValue, maxValue, automationRate } descriptors.
  • Return true from process() to keep the processor alive; false or no return shuts it down.

Step 3 — Wire up the node graph

  • Instantiate the node on the main thread: new AudioWorkletNode(ctx, 'name', options).
  • Use node.connect(destination) and source.connect(node) to build the signal path; AudioContext.destination is the hardware output.
  • Access AudioParams via node.parameters.get('paramName') — set .value for immediate changes.
  • Schedule smooth automation with .linearRampToValueAtTime(), .setTargetAtTime(), or .setValueCurveAtTime() on the AudioParam.
  • Tear down cleanly: node.disconnect(), then source.stop(), then audioContext.close().

Step 4 — Worklet ↔ main thread communication

  • Use this.port.postMessage() / node.port.onmessage for low-frequency control (meters, state changes, error reporting).
  • Batch postMessage calls; avoid sending one per render quantum (currently ~344/sec at 44.1 kHz with 128-frame quanta).
  • For high-frequency or low-latency control (e.g. live gain, pitch), share a SharedArrayBuffer and read/write integer views with Atomics.load() / Atomics.store(). Scale floats to integers or bit-cast through a private buffer; Atomics does not operate on Float32Array.
  • Cross-origin isolation (COOP: same-origin + COEP: require-corp response headers) is required for SharedArrayBuffer.

Read the full file on GitHub · 50 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 50 lines · 98 tokens per session scan A 38c9985fca1b

Subscribe to this mod's changes

webaudio-guide is a skill published in the GitHub repository kunitoki/sonic-skills (18 stars, last pushed 3mo ago), licensed Unlicense. It adds 98 tokens to every session and 913 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

omnivoice

Local TTS, voice cloning, voice design, and video dubbing via the OmniVoice Studio MCP server (open-source ElevenLabs alternative; nothing leaves the machine, runs on MPS/CUDA/CPU). Use when: (1) generating speech from text in any of 646 languages, (2) cloning a voice from a 3-second reference clip, (3) designing a…

broomva/skills · 222 tokens

talkback

Speak an explanation out loud while working in any project — tiered text-to-speech with a pluggable backend (ElevenLabs by default and quota-guarded, macOS say via --fast for free instant local speech, local OmniVoice as an unlimited private tier). Markdown-aware, so code fences, URLs and deep paths collapse to short…

broomva/skills · 190 tokens

livecoding

Algorave-grade livecoded music workflow — TidalCycles patterns (Haskell DSL driving SuperDirt over OSC) + Hydra-synth visuals (browser or VS Code Simple Browser via a local HTML page that loads hydra-synth from CDN). Wraps the boot ritual (SuperCollider → SuperDirt → Tidal → Hydra), a vibe-descriptor pattern generator…

broomva/skills · 128 tokens

AudioMind

Tired of juggling multiple audio APIs? This skill gives you one-command access to TTS, music generation, sound effects, and voice cloning. Use when you want to generate any audio without managing multiple API keys.

wells1137/media-skills · 46 tokens

Audio Transcriber

Transform audio recordings into professional Markdown documentation with intelligent summaries using LLM integration.

mayurrathi/awesome-agent-skills · 18 tokens

seedance-audio

This skill should be used when the user asks for Seedance 2.0 audio, dialogue, lip-sync, music, sound effects, ambience, beat-sync, audio-reference mapping, desync troubleshooting, or sound-driven visual timing.

Emily2040/seedance-2.0 · 52 tokens