@webaudio-kit/core
Browser-safe playback helpers, pitch utilities, frequency clamping, noise buffers, and per-call node cleanup.
webaudio-kit is a small React + TypeScript package set for tone generators, frequency sweeps, noise bursts, safe volume defaults, pitch labels, and analyser-driven UI in browser prototypes.
The controls and analyser now have room to breathe, so you can adjust the sound and watch the signal without fighting the hero layout.
pnpm add @webaudio-kit/react @webaudio-kit/coreUses the current waveform, gain, pan, master volume, and analyser route.
Noise buffers use the same safe routing: source, gain, pan, master volume, analyser, then destination.
A short low-gain sequence checks center tone, stereo pan, sweep, noise, and analyser routing without making medical claims.
The public API stays intentionally small for the first production release.
import { AudioProvider, useTone } from "@webaudio-kit/react";
function ToneButton() {
const tone = useTone({ frequency: 440, gain: 0.15, type: "sine" });
return (
<button type="button" onClick={() => void tone.play({ durationMs: 600 })}>
Play 440 Hz
</button>
);
}
export function App() {
return (
<AudioProvider>
<ToneButton />
</AudioProvider>
);
}pnpm dlx @webaudio-kit/cli agent-brief
pnpm dlx @webaudio-kit/cli agent-brief --target codex --out AGENTS.mdPublic package notes, GitHub release assets, and npm links are kept together so developers can verify exactly what shipped.
Browser-safe playback helpers, pitch utilities, frequency clamping, noise buffers, and per-call node cleanup.
AudioProvider plus hooks for tones, sweeps, noise bursts, audio test mode, master volume, context state, and analyser access.
Project setup helper that generates a public AI-agent brief with docs, npm, examples, browser audio, and safety context.
A Vite React sandbox for manually testing tone generation, sweeps, pan, gain, noise, and analyser output.
Tone, sweep, and noise nodes feed the master gain, analyser, then destination. The waveform should move while sound is playing.
AudioContext is created lazily after user interaction so React apps avoid browser autoplay violations.
The provider starts with a 0.2 master gain and examples keep gain controls bounded.
The demo draws analyser data so developers can verify the provider graph is live.
Short low-gain steps exercise tone, pan, sweep, noise, and analyser routing from one user action.
Package tarballs are built and reinstalled before publish so exports match the public API.
$ pnpm verify tests pass types pass packages build demo and site build lint and format pass
webaudio-kit can help build audible UI controls and prototypes. It is not certified audiology software, and it should not be used to diagnose hearing conditions or replace calibrated test equipment.