No sound running HTML5 build on Chrome

As above… HTML5 bundle seems fine.

HTML5 build on Firefox also is fine.

Is this a known issue?

image
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. <URL>

Isn’t this an effect of the autoplay change Google did a few years ago? (https://developers.google.com/web/updates/2017/09/autoplay-policy-changes) Or was it working recently for you in Chrome?

1 Like

That sounds about right. I’ll stick with Firefox for testing for the time being.

1 Like

Clicking on the canvas should be enough to get audio playing?

It should be possible to check the permission first before playing any audio. You could also add a dummy start screen to click before the actual game begins.

1 Like

How to actually fix it?

To get the message not to show? One way is to do what itch allows you to do instead of auto-starting an HTML5 game you have a button you click to begin the loading of the game (though you could still lazy load behind the scenes), this click allows the context to start at the very start of the engine sim. Otherwise the warning in the console doesn’t hurt anything.

Hmm, I thought I had similar problem with Secret Moon Station, but the whole sound is not working neither on Chrome nor in Opera :confused:

Is it working with other Defold games in your browser?

Yes, with Witchcrafter I have no such problems, but can’t find out what is wrong with SMS :confused:

Could be related to the audio files somehow. I’d compare what you have in Witchcrafter vs SMS, test Witchcrafter sounds in SMS.

1 Like

If you are using websocket you can play soundfx when you are connected to server.
If not using websocket, try calling a JS function (from Defold) to play sound on init.