# No sound in Unity WebGL build

**URL:** <https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900>\
**Category:** Unity\
**Tags:** html5, unity\
**Created:** [June 18, 2020, 3:53pm UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900 "2020-06-18T15:53:16Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaphaelHuot](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@RaphaelHuot](https://qa.fmod.com/u/RaphaelHuot)\
**Post date:** [June 18, 2020, 3:53pm UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/1 "2020-06-18T15:53:16Z")

</div>

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](http://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!

---

<div class="post-metadata">

**Author:** ![RaphaelHuot](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@RaphaelHuot](https://qa.fmod.com/u/RaphaelHuot)\
**Post date:** [June 18, 2020, 3:54pm UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/2 "2020-06-18T15:54:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [June 22, 2020, 2:51am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/3 "2020-06-22T02:51:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [June 22, 2020, 2:57am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/4 "2020-06-22T02:57:21Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [June 22, 2020, 3:00am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/5 "2020-06-22T03:00:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![YomYomNuts](https://avatars.discourse-cdn.com/v4/letter/y/0ea827/32.png) [@YomYomNuts](https://qa.fmod.com/u/YomYomNuts)\
**Post date:** [August 4, 2020, 8:16am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/6 "2020-08-04T08:16:33Z")

</div>

Hi brett,  
I try to change le DSPBufferSize, but nothing change, i have always the crackling effect with Chrome.  
I add this : result = coreSystem.setDSPBufferSize(2048, 8); in the RuntimeManager.cs  
But no effect, i use FMOD 2.00.10 and Unity 2019.3.13

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [August 4, 2020, 9:04am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/7 "2020-08-04T09:04:55Z")

</div>

Hi Yom Nuts.

Can you show me where you put that line? Was it before the system init call?  
What was the result return code?

---

<div class="post-metadata">

**Author:** ![YomYomNuts](https://avatars.discourse-cdn.com/v4/letter/y/0ea827/32.png) [@YomYomNuts](https://qa.fmod.com/u/YomYomNuts)\
**Post date:** [August 4, 2020, 9:37am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/8 "2020-08-04T09:37:58Z")

</div>

It’s on the Initialize function  
result = coreSystem.setAdvancedSettings(ref advancedSettings);  
CheckInitResult(result, “FMOD.System.setAdvancedSettings”);

result = coreSystem.setDSPBufferSize(2048, 8);  
CheckInitResult(result, “FMOD.System.setDSPBufferSize”);

if (!string.IsNullOrEmpty(Settings.Instance.EncryptionKey))

And the result code it’s OK

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [August 6, 2020, 6:50am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/9 "2020-08-06T06:50:54Z")

</div>

ok im guessing your update is not calling fast enough. Are you loading from file or stalling updates in any way? Strip back your own code and just let the sound play with nothing else happening to make sure it is not the game code.  
HTML5 audio mixing has to be treated very carefully compared to a normal platform, as there are no background threads.

---

<div class="post-metadata">

**Author:** ![YomYomNuts](https://avatars.discourse-cdn.com/v4/letter/y/0ea827/32.png) [@YomYomNuts](https://qa.fmod.com/u/YomYomNuts)\
**Post date:** [August 7, 2020, 1:30pm UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/10 "2020-08-07T13:30:46Z")

</div>

I’m not doing anything special, just call StudioEventEmitter and I don’t limit the FPS.  
It’s really just on Chrome that it does that.  
And i don’t understand this question "Are you loading from file or stalling updates in any way? ", i load my bank by the Streaming Assets folder, and in the FMOD settings i select specific bank to load with Master.strings & Master in first.  
You can try the version here [http://noisette.guillaume.free.fr/Sadhana](http://noisette.guillaume.free.fr/Sadhana)

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [August 10, 2020, 6:24am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/11 "2020-08-10T06:24:21Z")

</div>

hi,  
your demo actually played without any glitches for me. It might be to do with the speed of the CPU.

by loading - i mean your own game data… not just fmod loads.  
I wanted you to test it with nothing but sound playing, and no gameplay. ie a black screen.

If that works, and you reintroduce gameplay elements and it starts stuttering , then that is the thing to look at.

This is the point i’d start looking at the profiler in the browser and see what is throttling the audio.

---

<div class="post-metadata">

**Author:** ![YomYomNuts](https://avatars.discourse-cdn.com/v4/letter/y/0ea827/32.png) [@YomYomNuts](https://qa.fmod.com/u/YomYomNuts)\
**Post date:** [August 21, 2020, 8:11am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/12 "2020-08-21T08:11:39Z")

</div>

I finally found the problem, it comes from having several cameras in perspective in the scene…  
So many PostProcess was applied and so many ressources allow to that

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [August 22, 2020, 2:04am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/13 "2020-08-22T02:04:59Z")

</div>

thanks for the update and to see you resolved your issue.

---

<div class="post-metadata">

**Author:** ![paul.masristone](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/paul.masristone/32/2165_2.png) [@paul.masristone](https://qa.fmod.com/u/paul.masristone)\
**Post date:** [May 26, 2021, 4:54pm UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/14 "2021-05-26T16:54:20Z")

</div>

Could you share… How did this cause an issue? And what was your solution?

I have a scene with 2 cameras — main camera and a UI camera but no post-processing.

---

<div class="post-metadata">

**Author:** ![thygrrr](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@thygrrr](https://qa.fmod.com/u/thygrrr)\
**Post date:** [August 4, 2021, 10:55am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/15 "2021-08-04T10:55:28Z")

</div>

Yeah I run into similar problems, especially long ambient sounds are crackling.  
I do have multiple cameras, and it does seem to get worse where more particles are on screen.

Frame rate is really fast though, so I don’t know what’s up. I’ll try if enabling / disabling Graphics Jobs helps.

---

<div class="post-metadata">

**Author:** ![HaroldWSchranz](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/haroldwschranz/32/5113_2.png) [@HaroldWSchranz](https://qa.fmod.com/u/HaroldWSchranz)\
**Post date:** [June 6, 2023, 5:02am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/16 "2023-06-06T05:02:32Z")

</div>

I have a problem which might be related.

I followed the [https://www.fmod.com/docs/2.02/unity/integration-tutorial.html](https://www.fmod.com/docs/2.02/unity/integration-tutorial.html)  
and managed to customise the sounds with FMOD Studio and have it playing in the Unity GUI and also in a Windows 64 build but when I tried a WebGL build there is no sound:  
[Karting Micrograme - added FMOD - Unity Play](https://play.unity.com/mg/karting/karting-micrograme-added-fmod)

Ideas suggestions welcome. I am still learning Unity/C#/FMOD and so still have a learning curve to surmount - despite having decades in scientific programming where all I needed was a good editor and a trusty compiler!

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [June 8, 2023, 4:03am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/17 "2023-06-08T04:03:56Z")

</div>

did you check the information here? [https://www.fmod.com/docs/2.02/unity/platform-specifics.html#html5webgl](https://www.fmod.com/docs/2.02/unity/platform-specifics.html#html5webgl)

especially the user interaction requirement

---

<div class="post-metadata">

**Author:** ![HaroldWSchranz](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/haroldwschranz/32/5113_2.png) [@HaroldWSchranz](https://qa.fmod.com/u/HaroldWSchranz)\
**Post date:** [June 8, 2023, 4:57am UTC](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/18 "2023-06-08T04:57:26Z")

</div>

Thanks. I already know about that. The problem resides in one or more of the following:

1. whether user interaction is detected in a particular browser (engines and settings vary)
2. the kind of WebGL build (I had not had trouble having audio using Unity without FMOD in other projects)
3. the Win64 build is fine with audio provided by FMOD
4. what counts as user interaction (WASD and arrow keys?) or is there some other interaction required?
5. It’s not on my top list of priorities as I have a lot of other tasks which are more urgent - but I probably will try a really basic Unity project some time to help track the issue.
