I try to play a song on the browser. When I run the html following occurs : "Uncaught not ready to play file, buffer has yet to load. Try preload()"
HTML:
<!doctype>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script>
<script src="p5.js-master/p5.js-master/lib/addons/p5.sound.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
sketch.js:
var song; function preload() { song = loadSound("song.mp3"); } function setup() { createCanvas(100,100); song.play(); } function draw() { background(0); }
help!