decentral1se
4 years ago
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
1 changed files with
10 additions and
1 deletions
-
voicegardens/static/voicegardens.js
|
|
@ -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(); |
|
|
|
|
|
|
|