WebGL Issue - No Audible Sound Occasionally

Refer to the published project here: https://brandev.itch.io/fmod-webgl-no-sound

Issue:

When loading the “Go to next scene”, sometimes the audio becomes inaudible. This seems to happen if you click within the game window or outside first. I haven’t found a consistent way to reproduce this though.

Additional Details:

  1. This is using the code from the repository in: GitHub - fmod/unity-html5-demo: Demonstration of the correct way to load banks for HTML5 within Unity using the FMOD For Unity integration.
  2. This published version uses “Unity 2020.3.16f1” and “FMOD 2.02.20” (same as the one mentioned in the Github repo).
  3. I’ve also used “Unity 2021.3.26f1” and had the same issue I mentioned above.

Please reach out if you need any more details.

1 Like

Also find that the FMOD team’s version works without issue: Unity WebGL Player | Unity HTML Demo (fmod.com)

I found that this issue only happens in Google Chrome due to their new autoplay policy. (Unity - Manual: Audio in WebGL (unity3d.com)) . This still doesn’t answer why the FMOD team’s version works consistently on Google Chrome but not my itch.io version.

Apologies for the delayed response.

After a discussion with the development team, it seems that the behaviour you’re describing is the result of a user interaction requirement from the browser - the Unity WebGL example on our website is using an older version of FMOD that handled it differently from our more recent versions.

I would recommend grabbing the Core System from RuntimeManager and calling System::mixerSuspend and System::mixerResume together from an touch or click event handler and seeing whether that resolve the issue. If not, can I get you to set your logging level to “Log” and enable API error logging, and either:

  • Post a log with the aforementioned settings enabled where you’re able to reproduce the issue
  • Or update your itch.io project with those settings enabled so I can test it myself

I can confirm that the code in the itch.io page I sent has “System:mixerSuspend” and “System::mixerResume”. I’m using the same code as the “fmod/uity-html5-demo” github repo. The implementation of the suspend/resume can be found here: unity-html5-demo/Assets/HTML Demo/LoadBankAndScene.cs at 2.02 · fmod/unity-html5-demo (github.com)

Here is the pastebin of the log you requested. Please note, the errors in this log appear whether or not the “No Audible Sound” error occurs.pastebin.com/raw/pYSB6QBq

1 Like

Thanks for checking that for me.

Unfortunately, at present I don’t have any workarounds to offer, but I’ve passed this along to the development team for further investigation.

1 Like