Support click on/off recording

This commit is contained in:
decentral1se 2021-05-27 20:14:02 +02:00
parent 747c51e938
commit f9bb10ff1e
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A

View File

@ -4,6 +4,12 @@
// Voicegardens front-end Javascript
//
// The entire canvas
var _canvas;
// Offline recording duration
var offlineRecordingDuration = 6000;
// URL which exposes the archive saving API end-point
var archiveUrl = window.location + "add-to-archive";
var archiveListingUrl = window.location + "archive";
@ -60,6 +66,7 @@ function record() {
getAudioContext().resume();
if (microphone.enabled === true) {
recorder.record(recording);
setTimeout(stop, offlineRecordingDuration);
}
}
@ -152,6 +159,8 @@ function setupRecording() {
recording = new p5.SoundFile();
canvas.mousePressed(record);
// recordButton = createImg("../static/images/RECORD-COLOR.png");
// recordButton.mousePressed(record);
// recordButton.class("button record");
@ -506,7 +515,7 @@ function setup() {
/**
* The initial setup function called once on start.
**/
createCanvas(windowWidth, windowHeight);
canvas = createCanvas(windowWidth, windowHeight);
frameRate(frameRate);
setupRecording();