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

support for new Chrome audio context #17

Merged
merged 2 commits into from
Nov 9, 2016
Merged

support for new Chrome audio context #17

merged 2 commits into from
Nov 9, 2016

Conversation

honkskillet
Copy link
Contributor

This merge addresses the fact that chrome now longer uses webkitAudioContext. In this update, chrome will call the correct function to create an audio context. Also, chrome/webkit loads will now try all the provided urls. This addresses issues #13 and maybe #3.

Chrome no longer uses webkitAudioContext.  Instead has it's own AudioContext.

First made change to init lowLag's audioContext with the chrome version if webkitAudioContext doesn't exist.

Then, most recent versions of chrome use promises to decode the audio, instead of a callback style. (Not sure when that change took place?)  So now when using audioContexts (webkit or chrome) will try both callback and promise methods.

Then, Chrome's audio context also doesn't necessarily handle all the same audio formats that webkit did.  For example, on OSX most recent chrom audioContext does not handle .aiff files.  So I change the audio context loading function to recursively call itself if it cannot load the first url in the array of urls.  Now, audioContext loads should try all attempted urls just sm2 and audioTag.  

I tested this on OSX safari and chrome (most recent versions).
... to reflect that webkit/chrome will now try all the provided urls
@kirkjerk kirkjerk merged commit d42eda4 into kirkjerk:master Nov 9, 2016
@kirkjerk
Copy link
Owner

kirkjerk commented Nov 9, 2016

thanks!

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

Successfully merging this pull request may close these issues.

2 participants