            resizeTimeout = setTimeout(adjustCanvasWidth, 100);
          });

          const frequencyBinIndex = (f) => {
            const hzPerBin = (audioContext.sampleRate) / (2*analyser.frequencyBinCount);
            return parseInt((f + hzPerBin/2) / hzPerBin);
          };

          const drawSpectrum = () => {
            let ctx = spectrumCtx;
            let buffer = frequencyBuffer;
            let canvas = spectrumCanvas;
            let bufferLength = buffer.byteLength / 5;

            let