lecture 5 Flashcards
(7 cards)
what function would you use to capture video from your webcam?
capture = createCapture(VIDEO);
what would we have to do to get rid of the html video element but still display the video?
first we use capture.hide(); in setup then
image(capture, 0, 0); in the draw function
let adjustBrightness = map(mouseX, 0, width, 0, 4);
what does the above code implement?
based on the x of the mouse it adjusts the brightness of the video/image
how would you create a button in code?
let button;
button = createButton(‘play’);
if you wanted sound on your video how where would you first load it, and what could the code look like?
it would be loaded in the preload
function preload() {
bell = loadSound(“bell.mp3”);
}
p5 has speech synthesis, what code would you use to access it? in your code make it say ‘ correct answer’
let voice = new p5.Speech();
voice.speak(‘correct answer’);
it also has speech recognition, what code would be used to call it?
let myRec = new p5.SpeechRec();