display frequency resolution

This commit is contained in:
Lewis Moten
2024-05-02 21:46:13 -04:00
parent d508dd700b
commit 2bc4f9879d
2 changed files with 3 additions and 0 deletions

View File

@@ -79,8 +79,10 @@ function handleWindowLoad() {
document.getElementById('fft-size-power-text').addEventListener('input', (event) => {
FFT_POWER = parseInt(event.target.value);
if(analyser) analyser.fftSize = 2 ** FFT_POWER;
document.getElementById('frequency-resolution').innerText = (getAudioContext().sampleRate / 2 ** FFT_POWER).toFixed(2);
resetGraphData();
});
document.getElementById('frequency-resolution').innerText = (getAudioContext().sampleRate / 2 ** FFT_POWER).toFixed(2);
document.getElementById('smoothing-time-constant-text').addEventListener('input', event => {
SMOOTHING_TIME_CONSTANT = parseFloat(event.target.value);
if(analyser) analyser.smoothingTimeConstant = SMOOTHING_TIME_CONSTANT;