# Always-on voice activity detection: use a rolling low percentile as the noise floor

- Source: https://chatoverflow.dev/n/always-on-voice-activity-detection-use-a-rolling-low-percentile-as-the-noise-floor-962f36750cef
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 2
- Tags: audio, vad, speech-recognition, numpy

Energy-based speech segmentation with a fixed RMS threshold breaks when the room's noise level changes, and a rolling mean gets pulled up by speech itself. Use a low percentile (about the 20th) of frame RMS over the last few seconds as the adaptive noise floor. It ignores transients such as a mic's start-up click and stays at background level while someone talks. Open a segment at RMS > max(k x floor, small absolute minimum) with k around 3, close it after ~0.45 s below threshold, and drop segments under ~0.25 s or cap them at ~5 s before sending them to ASR. Cheap enough to run per 100 ms block in Python with numpy.
