Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of CORS headers breaks MediaElementAudioSource #7

Open
wfwalker opened this issue Apr 6, 2016 · 1 comment
Open

lack of CORS headers breaks MediaElementAudioSource #7

wfwalker opened this issue Apr 6, 2016 · 1 comment

Comments

@wfwalker
Copy link

wfwalker commented Apr 6, 2016

I wanted to extend your test.html to use MediaElementAudioSource with Web Audio API instead of just using AudioElement, something like this:

myAudioElement = new Audio(sound.previews['preview-hq-mp3']);
mySource = gAudioContext.createMediaElementSource(myAudioElement);
mySource.connect(gAudioContext.destination);

But no sound is heard, neither in Firefox nor in Chrome. Chrome gives this error message:

client-test.html:1 MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://www.freesound.org/data/previews/96/96541_7037-hq.mp3
@wfwalker
Copy link
Author

wfwalker commented Apr 6, 2016

Per @itsjoesullivan on web-audio Slack, you can work around this using myAudioElement.setAttribute('crossorigin', 'anonymous')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant