Last active
November 3, 2015 16:27
-
-
Save claytical/4090084d4cf5d3241ac6 to your computer and use it in GitHub Desktop.
Loading a sound file in p5js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shut up lauren