lecture 5 Flashcards

(7 cards)

1
Q

what function would you use to capture video from your webcam?

A

capture = createCapture(VIDEO);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what would we have to do to get rid of the html video element but still display the video?

A

first we use capture.hide(); in setup then
image(capture, 0, 0); in the draw function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

let adjustBrightness = map(mouseX, 0, width, 0, 4);

what does the above code implement?

A

based on the x of the mouse it adjusts the brightness of the video/image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how would you create a button in code?

A

let button;

button = createButton(‘play’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

if you wanted sound on your video how where would you first load it, and what could the code look like?

A

it would be loaded in the preload
function preload() {
bell = loadSound(“bell.mp3”);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

p5 has speech synthesis, what code would you use to access it? in your code make it say ‘ correct answer’

A

let voice = new p5.Speech();
voice.speak(‘correct answer’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

it also has speech recognition, what code would be used to call it?

A

let myRec = new p5.SpeechRec();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly