xxxxxxxxxx
19
let mic;
function setup() {
createCanvas(400, 400);
mic = new p5.AudioIn();
mic.start();
}
function draw() {
background(220);
let level = mic.getLevel();
if (level > 0.1) {
background(random(255), random(255), random(255));
}
ellipse(width/2, height/2, level * 1000, level * 1000);
// console.log(level);
}