xxxxxxxxxx
31
let talk;
let c = 0;
let d = 0;
let e = 0;
function setup() {
createCanvas(400, 400);
talk = new p5.AudioIn();
talk.start();
}
function draw() {
background(c, d, e);
let vol = talk.getLevel();
noStroke();
fill(255);
let newVol = vol*width
ellipse(width/2, height/2, newVol, newVol)
if (newVol > 10){
c = random(0, 255)
d = random(0, 255)
e = random(0, 255)
}
else{
c = 0
d = 0;
e = 0;
}
console.log(vol*200)
}