Browse Source

Generate a new shape if a sound is recorded

main
Luke Murphy 5 years ago
parent
commit
520b841c97
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 7
      vocoder/static/vocoder.js

7
vocoder/static/vocoder.js

@ -12,6 +12,7 @@ var archiveUrl = serverUrl + '/add-to-archive/';
var mic, recorder, soundFile;
var recordingTimeout = 30000; // 30 seconds (in milliseconds)
var shouldGenerateNewShape = false;
function setupRecording(){
mic = new p5.AudioIn();
@ -31,6 +32,7 @@ function setupRecording(){
function doStopping(){
if (recorder.recording) {
recorder.stop();
shouldGenerateNewShape = true;
}
};
@ -100,4 +102,9 @@ function setup(){
}
function draw(){
if (shouldGenerateNewShape){
collectSoundParamters();
generateShape();
shouldGenerateNewShape = false;
}
}

Loading…
Cancel
Save