1Samples to frequencies
The sound arrives as fs numbers a second. The browser's analyser takes the latest N of them, multiplies by a window that fades the ends, and runs a fast Fourier transform, which splits them into N/2 frequency bins an equal distance apart. More samples give finer bins but a blurrier sense of time, so a spectrogram always trades one for the other.
Δf = fs / Nbin spacing… / … = …
X_k = Σₙ wₙ xₙ e^(−2πikn/N), f_k = k · Δfbin k measures frequency f_kwindow length …