Support click on/off recording
This commit is contained in:
parent
747c51e938
commit
f9bb10ff1e
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user