Audio in Chrome
madam

Hello

I have made several Wade games that are published / linked to from many different websites.

With the new version of Chrome, I have no audio in NONE of my games! I read that this is something that Chrome has changed recently (WebAudio autoplay policy) but the question is what can I do to get audio working again?

1 Comment
Gio

Hi madam

From the next release of WADE this will happen automatically, but for now you can manually fix your audio issue by adding this code to any onMouseUp or onClick event handler:

var context = wade.getWebAudioContext();
if (context)
{
    context.resume();
}

You are right, this is something that has changed recently in Chrome. If your site is not one of a handful "special" sites like youtube, then you cannot autoplay audio. You need to have something like a "Click to start" button, where you resume the WebAudio context using the code I posted here.

Wade was already doing something similar automatically on the first click on the page. However now they've changed the rules (or rather Google's implementation of the rules, the web standard was not changed), so we'll need to update the engine code. In the meantime, this workaround should do the trick.

Post a reply
Add Attachment
Submit Reply
Login to Reply