xxxxxxxxxx
12
// Load and play a sound file
// Based on reference example: https://p5js.org/reference/#/p5.SoundFile
function preload() {
soundFormats('mp3', 'ogg');
mySound = loadSound('doorbell.mp3');
}
function setup() {
mySound.setVolume(0.1);
mySound.play();
}