Tone and noise combo.
Combine tone and noise hooks under one provider to model richer UI feedback with one shared stop control.
Use this in a React component.
Keep playback inside a user action. The provider creates AudioContext lazily and routes playback through the safe graph.
import { AudioProvider, useNoise, useTone } from "@webaudio-kit/react";
function ComboFeedback() {
const tone = useTone({ frequency: 523.25, gain: 0.1, durationMs: 420 });
const noise = useNoise({ type: "pink", durationMs: 520, gain: 0.04 });
const play = async () => {
await tone.play();
await noise.play();
};
return (
<>
<button onClick={() => void play()}>Play combo pattern</button>
<button onClick={() => { tone.stop(); noise.stop(); }}>Stop combo</button>
</>
);
}
export function App() {
return (
<AudioProvider>
<ComboFeedback />
</AudioProvider>
);
}Run the focused surface.
Each page keeps one primary workflow near the snippet, then leaves the full workspace below for broader testing.
Combined hook workflow
Use one provider for multiple playback hooks and stop everything through one control.
Try every control together.
Use the shared workspace when you want tone, sweep, noise, test mode, volume, pan, waveform, and spectrum controls on one screen.
Play a tone. Sweep a range. Burst noise.
Uses 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.
- Center tone320ms
- Left pan320ms
- Right pan320ms
- Short sweep700ms
- Pink noise450ms