open-audiovisual
Search GitHub

oav-p5 reference · Loading options

record#

optionoav-p5
?oav_record=on | nomic | off

Whether recording is available and whether it includes the microphone: on, nomic or off.

With on, ⏺ and 📷 are in the 🎹 panel and startRecording() records the canvas together with the sound the sketch makes, the microphone included when it is on. nomic keeps the microphone out of the recording. With it in and no headphones, the speakers are recorded a second time through the microphone, so leave it out when you play sound out loud. off takes ⏺ and 📷 away and makes startRecording() do nothing.

off is a promise to the page, like mic=off: a piece that must not be captured can say so. One take can still choose its own: startRecording({ mic: false }).

Type
String
Values
on | nomic | off
default
on

Anything else means on.

Notes

  • Set it before oav-p5 loads. window.OAV_P5 = { record: … }; above the loader line wins, then ?oav_record=… on the page address, then ?record=… on the script's own URL. Values in window.OAV_P5 are turned into text, so write 'off', not false. On OpenProcessing the page address takes ?sketch_oav_record=… (the project's README says OpenProcessing forwards it to the sketch).

Examples

jsOpenProcessing ↗
window.OAV_P5 = { record: 'nomic' };

function setup() {
  createCanvas(400, 300);
}

function keyPressed() {
  if (key === 'r') startRecording(3);   // three seconds, without the microphone
}

function draw() {
  background(20 + 20 * sin(frameCount * 0.05));
  fill(255);
  text('press r to record 3 seconds (' + (recordingIsOn ? 'recording' : 'idle') + ')', 20, 30);
}
Press r: three seconds of the canvas are recorded and downloaded, with the microphone left out even if it is on.

Related

  • startRecording() Records the canvas and the sound your sketch makes into one video file, and returns a promise that says whether the recording began.
  • recfps The frame rate of recorded video, 1 to 60 frames a second.
  • reclimit The longest one recording may last, in seconds: a take stops by itself there.
  • title A name that goes into the file name of recordings and images, as in oav-my-piece-20261015-183012.mp4.
  • recordingIsOn Whether a recording is running right now.

p5/oav-p5.js, line 131

↑ Back to top · All names