Skip to content

Instantly share code, notes, and snippets.

@claytical
Last active November 3, 2015 16:27
Show Gist options
  • Save claytical/4090084d4cf5d3241ac6 to your computer and use it in GitHub Desktop.
Save claytical/4090084d4cf5d3241ac6 to your computer and use it in GitHub Desktop.
Loading a sound file in p5js
var ferambie;
function preload() {
ferambie = loadSound('ferambie.mp3');
}
function setup() {
// uncomment this line to make the canvas the full size of the window
createCanvas(windowWidth, windowHeight);
// the volume is a number between 0 and 1
ferambie.setVolume(0.5);
}
function draw() {
// draw stuff here
// ellipse(width/2, height/2, 50, 50);
}
function mousePressed() {
ferambie.play();
}
@fabiolr
Copy link

fabiolr commented Nov 3, 2015

shut up lauren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment