Decibel Meter: A Sound Level Meter in the Browser
A lot of people type “decibel meter” into the Chrome Web Store, and the most installed result is rated three stars. That was the whole brief. Decibel Meter is my answer: press Start, allow the microphone once, and see how loud the room is in dB(A), with min, max, the average since you began, a 60-second chart and the current level on the toolbar badge.
A PRO switch adds what a handheld meter has: Fast and Slow response, flat dB(Z) next to dB(A), calibration against a reference device, a noise alert and a CSV log of the session. The alert is what turns it into a classroom noise monitor. It watches the average over a window you pick, from five seconds to five minutes, so one slammed door does not set it off.
Three things that are easy to get wrong
Poll the analyser and you lose samples. The obvious build is an AnalyserNode read on every requestAnimationFrame. It skips or double-counts samples whenever the frame rate drifts, and it stops entirely when the window is in the background, which is exactly when a noise monitor is supposed to be working. The meter sums the squared samples in an AudioWorklet instead, every 50 ms, on the audio thread, and the page only does arithmetic on what it is sent.
An average of decibels is not an average. Ten minutes at 50 dB and ten at 80 dB do not average to 65. Decibels are a log scale, so the average has to be taken over energy and converted back, and the honest answer is about 77: the loud half dominates, as it does for your ears. That is Leq, and it is what the meter shows as the average.
Your microphone is not flat. It hears bass and treble differently from people, which is what A-weighting corrects for. The filter is the IEC 61672 curve, built as three second-order sections, and it stays within 0.3 dB of the reference up to 2 kHz. What no filter fixes is that a laptop microphone has no absolute scale. The meter adds a fixed offset that puts a quiet room at 30–40 dB, and PRO lets you calibrate against a real meter if you have one. It is a good guide to how loud a room is. It is not a certified instrument, and it does not pretend to be one.
Why it opens a window
The toolbar popup is where an extension’s UI normally lives, and it does not work here: a popup cannot show the microphone permission prompt, and it closes the moment it loses focus, which would stop the measurement. So the icon opens the meter in a small window of its own and focuses it on the next click instead of opening a second one. It keeps measuring while you work in other tabs.
Try it
Decibel Meter is free in the Chrome Web Store, with no account. If your reading disagrees with a real meter, or the alert fires when it should not, I would like to hear about it at anton@kopylov.net.