From 4fcb9fd0bea8e29bc74076bff2c33526ce4ee769 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 15 Feb 2020 15:25:35 +0100 Subject: [PATCH] Run shape generation after sounds collected --- voicegardens/static/voicegardens.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 168de7c..3c4b966 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -69,9 +69,6 @@ function stop() { if (recorder.recording) { recorder.stop(); - // signal to the draw loop that we should generate a new shape - newSoundJustRecorded = true; - // https://p5js.org/reference/#/p5.SoundFile/getPeaks amplitude = recording.getPeaks(1)[0] * 100; @@ -80,6 +77,9 @@ function stop() { // automatically archive this sound to the back-end sendToArchive(); + + // signal to the draw loop that we should generate a new shape + newSoundJustRecorded = true; } }