From 8af457e6267796659432a5ffc917d0c87fa3c5f0 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 7 Feb 2020 12:52:37 +0100 Subject: [PATCH] Store the amplitude --- voicegardens/static/voicegardens.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 9d78186..c11165b 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -80,7 +80,7 @@ function stop() { pitch = fft.analyze(); // https://p5js.org/reference/#/p5.SoundFile/getPeaks - amplitude = recording.getPeaks(); + amplitude = recording.getPeaks(1)[0] * 100; // https://p5js.org/reference/#/p5.SoundFile/duration duration = recording.duration();