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

Update Audio Engine to support new/future Chrome Behavior on Web Audio #4354

Closed
davrous opened this issue May 22, 2018 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@davrous
Copy link
Member

davrous commented May 22, 2018

Following Forum thread: www.html5gamedevs.com/topic/37632-audiocontext-error

Chrome will prevent audio from playing before any user gesture: https://bugs.chromium.org/p/chromium/issues/detail?id=840866#c103

We need to update the audio engine to follow Google's recommendations: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio

@davrous davrous added the audio label May 22, 2018
@davrous davrous added this to the 3.3 milestone May 22, 2018
@davrous davrous self-assigned this May 22, 2018
@deltakosh deltakosh modified the milestones: 3.3, 4.0 Aug 6, 2018
@davrous
Copy link
Member Author

davrous commented Sep 12, 2018

Implementing suggestion from: https://sites.google.com/a/chromium.org/dev/audio-video/autoplay.
We will create the audioContext as soon as a sound object is created but it will be resume as soon as a user's interaction will be triggered. To know that the audioContext is muted, you need to check the state property that will be "running" if everything's ok otherwise will be set to "suspended". To unmute it, you need to call audioContext.resume() inside a user's interaction (click for instance).

@davrous
Copy link
Member Author

davrous commented Sep 13, 2018

Fixed via this PR: #5139

@davrous davrous closed this as completed Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants