To be able to interact with the microphone, we need to follow this steps (or similars):
function setup() we have to assing, to this variable, the value of the mic input. We will do it writing this line of code: mic = new p5.AudioIn();. mic.start();.function draw(), map the mic input and assign it the mapped value, we do it because the mic input is a value that varies between 0 and 1, and we almost never need a value between 0 and 1, so we map it writing var h = map();.See the Pen vdobGR by DÃdac Jaquet (@didacjaquet) on CodePen.