# Unity FMOD in WebGL, when losing focus, the sound becomes very strange

**URL:** <https://qa.fmod.com/t/unity-fmod-in-webgl-when-losing-focus-the-sound-becomes-very-strange/22008>\
**Category:** Unity\
**Tags:** unity\
**Created:** [August 16, 2024, 10:09am UTC](https://qa.fmod.com/t/unity-fmod-in-webgl-when-losing-focus-the-sound-becomes-very-strange/22008 "2024-08-16T10:09:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhong](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/zhong/32/7128_2.png) [@Zhong](https://qa.fmod.com/u/Zhong)\
**Post date:** [August 16, 2024, 10:09am UTC](https://qa.fmod.com/t/unity-fmod-in-webgl-when-losing-focus-the-sound-becomes-very-strange/22008/1 "2024-08-16T10:09:20Z")

</div>

Unity FMOD in WebGL, when losing focus, the sound becomes very strange, But using Unity AudioSource does not have this issue.

I know that I can call FMODUnity.RuntimeManager.CoreSystem.mixerSuspend() in the OnApplicationFocus method of MonoBehaviour to stop these strange sounds. However, in some embedded WebGL environments within apps, it does not always work. For example, in TikTok. Sometimes, after switching back to the app from the background, the sound becomes weird again. The issue is that this problem does not occur with Unity’s default AudioSource, so it seems not to be related to the hardware, WebGL, or the Unity engine. It’s more like an issue with how FMOD itself handles sounds in WebGL.

My FMod is 2.02.22, Unity version is 2022.3.21f1. Is there any solution?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 21, 2024, 6:26am UTC](https://qa.fmod.com/t/unity-fmod-in-webgl-when-losing-focus-the-sound-becomes-very-strange/22008/2 "2024-08-21T06:26:50Z")

</div>

The ‘strange sound’ when the app is in the background is caused by the `StudioSystem::update()` not being called enough, this is because when the app is in the background Unity limits the app to 1fps and this is what drives `Monobehavior::update()` which is used to call `StudioSystem::update()`.

If the game is still running in the bacground and you call `mixerSuspend()`, the game can still make calls to FMOD but they will not be processed until `mixerResume()` is called, which will result in it processing all the queued commands at once which could also cause ‘strange sounds’.
