OAVp5.record#
objectoav-p5OAVp5.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
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);
}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 torecordingSaved(info)and to the returned promise.recordingIsOnWhether a recording is running right now.OAVp5.soundThe object behind the sound names: the state, the instrument, the error, the loading progress and the loaded parts of @openav/sound.OAVp5.drumsThe object behind the drum names: the state of the machine, its counters, the line of rhythm, its history and the loaded machine.