How it works
- The Web Audio API builds a ten-second noise buffer in memory and loops it, so nothing is streamed or downloaded.
- White noise is uniform random samples. Pink noise runs those samples through a Voss–McCartney filter bank so energy falls about 3 dB per octave. Brown noise integrates them, falling about 6 dB per octave — deeper still.
- The volume slider is squared before it reaches the gain node, so the middle of the slider sounds like the middle to your ears.
- When the timer has 30 seconds left the gain ramps to silence, so you are not woken by an abrupt stop.