No sound in Unity WebGL build

Hi,

I managed to create a HTML5 WebGL build of my Unity project using FMOD and everything works fine when I load it locally on Firefox. However, when I upload the project to itch.io, there’s no sound. I’ve tried Chrom, Firefox and Opera, none of those give me sound.

Is there something I’m missing? I have followed all the instructions of the documentation. I am using libfmodstudiounityplugin.bc. FMOD 2.00.09 (Unity Verified) and Unity 2019.2.21f1 Personal.

Please help!

Here’s the project on itch.io if this can give you any information: https://worthless-idea.itch.io/bdsmcq

Hi Raphael,
Thanks for that . I can see how you dont get sound, it looks like the broswer ‘click / interact to get audio’ is not being used. Try clicking on the unity logo as it starts up and you will get sound.

With web browsers, you will have to cause the mixerSuspend/resume code in FMOD to be called from user input, you can make a prompt in your own app to make this happen.

See in /Assets/Plugins/FMOD/RunstimeManager.cs that ‘OnApplicationPause’ is used to execute the suspend resume logic, mentioned in https://fmod.com/resources/documentation-api?version=2.1&page=platforms-html5.html#safari-and-chrome-browser-user-interaction-requirement-use-for-all-browsers

It has to come from a callstack that is triggered from a user interaction. It cannot typically be passively called without a click or tap involved.

if you get crackling you might want to look at altering buffer sizes with lowlevelSystem.setDSPBufferSize in the same .cs file where setOutput/setSoftwareChannels/setSoftwareFormat etc are called.

FMOD does not run in a thread so if the framerate is slow, it may miss mix opportunities to keep a continous stream.