So i'm trying to test out using Howler.js to play an audio file. When I run this html file and press the button I get an error in console saying "An array of source files must be passed with any new Howl."
html:
<!DOCTYPE html>
<html>
<head>
<title>Play Sound</title>
<script src='./howler.js/dist/howler.js'></script>
</head>
<body>
<button id="btn">Play</button>
<script>
var pong = new Howl({urls: ['sound.mp3', 'sound.ogg']});
document.getElementById('btn').onclick=function(){pong.play();}
</script>
</body>
</html>
Should be
var pong = new Howl({
src: ['sound.mp3', 'sound.ogg']
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With