How the Noise Is Generated and Played
AnyTool White Noise Generator synthesizes every sound procedurally with the native Web Audio API — there are no audio files to download or stream. A few seconds of the chosen noise colour is written into an AudioBuffer using the correct algorithm and looped seamlessly with an AudioBufferSourceNode: white noise is uniform random samples (a flat spectrum), pink noise uses Paul Kellet’s refined seven-term filter to approximate a −3 dB/octave slope, brown (red) noise is a leaky integration of white noise for a −6 dB/octave slope, and blue and violet noise are produced by differentiating white noise to tilt energy toward the highs. The looping source feeds a high-pass and a low-pass BiquadFilter (for tone shaping and ambient bandpass effects), then a GainNode, then an AnalyserNode that drives a live spectrum, then the destination. Gain is always moved with linearRampToValueAtTime so starting, stopping, switching colours and the sleep-timer fade are click-free, and the AudioContext is created lazily on the first gesture (autoplay policy), suspended when idle and closed on unmount.
- BufferSource(loop) → highpass → lowpass → GainNode → AnalyserNode → destination, all native Web Audio
- White = uniform random; pink = Paul Kellet refined filter (−3 dB/oct); brown = leaky-integrated white (−6 dB/oct)
- Blue and violet are made by differentiating white noise (+3 / +6 dB/oct tilt)
- Gain ramped with linearRampToValueAtTime — no clicks when switching or fading
- Synthesized locally: no audio files, no CDN, works offline; mic never used
