# WebGL AudioContext warning with only FMOD Studio Listener in the scene

**URL:** <https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761>\
**Category:** Unity\
**Created:** [May 13, 2022, 3:32pm UTC](https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761 "2022-05-13T15:32:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AArtlone](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@AArtlone](https://qa.fmod.com/u/AArtlone)\
**Post date:** [May 13, 2022, 3:32pm UTC](https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761/1 "2022-05-13T15:32:05Z")

</div>

Hi,

I would like to report an issue that I am experiencing with FMOD.

I am using Unity 2020.3.24.

STR:

- Create an empty Unity project
- Go to Edit/ProjectSettings/Audio and disable set ‘Disable Unity Audio’ to true
- Create a WebGL build
- Once the build is done and your browser load the application on a web page, open the Console
- You will see that there is no “The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.” warning
- Go back to Unity and add an FMOD Studio Listener to your scene
- Save the scene
- Create another WebGL build
- Once the build is done and your browser load the application on a web page, open the Console
- You will see that “The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.” warning shows up!

I would like to know why having an FMOD Studio Listener in a scene causes this issue and if you have any suggestions to address this.

The solution that I have for this right now, is to add the FMOD Studio Listener to my scene, only after “user gesture on the page”. But this feels wrong.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 18, 2022, 12:49am UTC](https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761/2 "2022-05-18T00:49:43Z")

</div>

This is expected behaviour. Adding a listener counts to the browser as it trying to play audio so it will throw this error when the Unity scene loads up and tries to add a listener to the system. You can read more about user gestures in our documentation:

[https://fmod.com/resources/documentation-api?version=2.02&page=platforms-html5.html#user-interaction-requirement](https://fmod.com/resources/documentation-api?version=2.02&page=platforms-html5.html#user-interaction-requirement)

---

<div class="post-metadata">

**Author:** ![AArtlone](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@AArtlone](https://qa.fmod.com/u/AArtlone)\
**Post date:** [May 19, 2022, 10:41am UTC](https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761/3 "2022-05-19T10:41:13Z")

</div>

Okay, that is clear.

This issue also occurs when you try to load banks before a user gesture, right?

What is the most optimal wait to load banks and wait for them?

Also, there is a WaitForAllSampleLoading method in the RuntimeManager. How exactly can I know when it has finished waiting? My expectation from a method that starts with “Wait” is that it would return WaitUntil or would allow passing a callback.

Thanks 🙏

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 22, 2022, 11:36pm UTC](https://qa.fmod.com/t/webgl-audiocontext-warning-with-only-fmod-studio-listener-in-the-scene/18761/4 "2022-05-22T23:36:31Z")

</div>

There is no callback for `WaitForAllSampleLoading` but it will stop all FMOD calls until it has finished loading since it blocks the thread it’s on. Also, please note that `WaitForAllSampleLoading` does not work on HTML5 builds.
