diff --git a/src/index.js b/src/index.js index 6cb1c26..95c423c 100644 --- a/src/index.js +++ b/src/index.js @@ -83,7 +83,7 @@ class ClapDetector { const duration = get(stats, 'Length (seconds)') const rms = get(stats, 'RMS amplitude') const max = get(stats, 'Maximum amplitude') - return (duration < CLAP_MAX_DURATION && max > CLAP_AMPLITUDE_THRESHOLD && rms < CLAP_ENERGY_THRESHOLD) + return (duration < (CLAP_MAX_DURATION / 1000) && max > CLAP_AMPLITUDE_THRESHOLD && rms < CLAP_ENERGY_THRESHOLD) } handleClap() {