Ask HN: How to load a sound in JavaScript from external URL

1 points by optikals ↗ HN
Hi, can anyone help me, please? This code works fine:

var CrossfadeSample = function() { loadSounds(this, { drums: 'drums.wav', organ: 'organ.wav' }); this.isPlaying = false; }

But when I put the external URLs, it stops working:

var CrossfadeSample = function() { loadSounds(this, { drums: 'http://anothersite.com/sounds/drums.wav', organ: 'http://anothersite.com/sounds/organ.wav' }); this.isPlaying = false; }

Thank you.

3 comments

[ 10.0 ms ] story [ 468 ms ] thread
Sorry, you want StackOverflow for this.
It's because of CORS. But anyway, ask this on Stack Overflow