xxxxxxxxxx
26
let noisy;
function preload() {
noisy = loadSound("noise.mp3");
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
textAlign(CENTER, CENTER);
textSize(50);
fill("red");
text("click", width / 2, height / 2);
}
function mousePressed() {
if (noisy.isPlaying()) {
noisy.pause();
} else {
noisy.play();
}
}