open-audiovisual
Search GitHub

oav-p5 reference · Recording

OAVp5.record#

objectoav-p5
OAVp5.record

The object behind the recording names: the state, the time, the last file, the formats this browser can write and the screenshot function.

OAVp5.record (also reachable as midi.record) is what startRecording(), stopRecording() and recordingIsOn are built on. It holds the state of the recording, how many seconds it has run, the last file's info, the sources in the take, and the fps and limit in force. formats() says what the browser can write, shot() saves a PNG of the canvas and on() listens to 'start' and 'saved'. start and stop are the same as the two global functions.

Notes

  • For a sketch the global names are enough. This object is for tools, the console and debugging.

Examples

jsOpenProcessing ↗
function setup() {
  createCanvas(400, 300);
  textSize(14);
}

function draw() {
  background(20);
  fill(255);
  const r = OAVp5.record;
  text('state: ' + r.state, 20, 30);
  text('seconds: ' + nf(r.seconds, 1, 1), 20, 60);
  text('limit: ' + r.limit + ' s at ' + r.fps + ' fps', 20, 90);
}
Three fields of the recording object; the state stays "off" until a take starts (press ⏺ in the 🎹 panel).

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.
  • stopRecording() Stops the recording; the video is finished, downloaded, and handed to recordingSaved(info) and to the returned promise.
  • recordingIsOn Whether a recording is running right now.
  • OAVp5.sound The object behind the sound names: the state, the instrument, the error, the loading progress and the loaded parts of @openav/sound.
  • OAVp5.drums The object behind the drum names: the state of the machine, its counters, the line of rhythm, its history and the loaded machine.

p5/oav-p5.js, line 1935

↑ Back to top · All names