soulwire / sketch.js

Cross-Platform JavaScript Creative Coding Framework
MIT License
4.09k stars 431 forks source link

Unable to use Pre-signed URL with audio path #95

Closed Simoneth closed 7 years ago

Simoneth commented 7 years ago

Infinite love for this script!

From https://github.com/soulwire/sketch.js/issues/87 example I tried to use as MP3_PATH a pre-signed url but it's not working. This error occured only using this script:

Uncaught (in promise) DOMException: Failed to load because no supported source was found.

Is there any way to solve it? Thanks!

Simoneth commented 7 years ago

I just start a bounty on SO http://stackoverflow.com/questions/43657794/sketch-js-how-to-use-aws-pre-signed-url-on-audio-tag related to this issue

soulwire commented 7 years ago

Are you able to load the audio as a byte array via fetch api / xmlhttprequest? If so you could use AudioBufferSourceNode instead of MediaElementAudioSourceNode

soulwire commented 7 years ago

Going to close this because it's not directly related to Sketch. But I've updated the codepen demo to use SoundCloud to play tracks, since their CORS setup works. Maybe that's useful? https://codepen.io/soulwire/pen/Dscga