See the Pen WzNxeN by NombreNombre (@NombreNombre) on CodePen.

Sound

This code is used to play a sound when clicking on the page.

To Start you must start with creating the variable sound.

Then you create the function setup, which you will create the canvas and add this command:

sound = loadSound("File on mp3"); You always have to link the sound it's recommendable to put the sound on the folder with the code

After this, you create the function mousePressed(){}and inside of it sound.play()

And that is how you link an image using p5.js. For the code click on this link https://nombrenombreimagemap.neocities.org/faceothers/Facesound/sound.html

I must add that the sound doesnt work because you can't link it but if you try link it and open it on local it works