Open sebhaase opened 8 years ago
Are you running the file in a webserver? XHR calls only work from inside webservers for browser security reasons.
no. think of this as a "save complete web page" ... i.e. index.html + resources (including js and wav files)
Unfortunately, even if your application is off-line, you still need to run a webserver in your project root directory for XHR (Ajax) loading of sound files. (The WebAudio API requires XHR to decode sound files.)
What if I had the (local) file as part of the HTML DOM, i.e.
<audio id=aaa> <source src="...m-0.wav"> </audio>
?
Now I should even be able to play it like this:
$("#aaa")[0].play()
Could I somehow adapt this to the source.js infrastructure ...?
I'm getting
sound.js:570 XMLHttpRequest cannot load file:///Users/...m-0.wav. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Can
sound.load()
be told not to use ajax ? Thanks.