# Unity/Fmod: Adaptive Music in WebGL

**URL:** <https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168>\
**Category:** FMOD Studio\
**Tags:** unity\
**Created:** [October 7, 2024, 10:23pm UTC](https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168 "2024-10-07T22:23:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhoogsteder](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jhoogsteder](https://qa.fmod.com/u/jhoogsteder)\
**Post date:** [October 7, 2024, 10:23pm UTC](https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168/1 "2024-10-07T22:23:30Z")

</div>

Hey everyone!

I was looking through the manual, but couldn’t find my answer there specifically, so figured I’d ask here:

I’m trying to set up a super simple adaptive music demo for pitches and generally showcasing adaptive music at lectures. Very simple, just a Unity project with a play button, and a couple of buttons for parameter/intensity changes that trigger transitions.

When I build to Mac/Windows, the app works flawlessly, but when building and testing in WebGL, I get zero response from the state/parameter changes. The play button works, but nothing else. When I change the build settings to WebGL, it still works great in Unity, but the problems arise when testing the build locally in the browser.

Is there anything I can do about this, or is this the limitation of WebGL today?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 9, 2024, 2:56am UTC](https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168/2 "2024-10-09T02:56:04Z")

</div>

Hi,

The issue is WebGL is single-threaded so it cannot load banks in the same manner you would use on other platforms.

We have an example script to asynchronously load banks and then trigger a scene load which can then play events: [FMOD Studio | Scripting Examples - Asynchronous Loading](https://fmod.com/docs/2.02/unity/examples-async-loading.html).

We also have a full Unity HTML5 demo on our GitHub: [GitHub - fmod/unity-html5-demo: Demonstration of the correct way to load banks for HTML5 within Unity using the FMOD For Unity integration.](https://github.com/fmod/unity-html5-demo) this displays using a loading scene with the script.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![jhoogsteder](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jhoogsteder](https://qa.fmod.com/u/jhoogsteder)\
**Post date:** [October 9, 2024, 7:08pm UTC](https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168/3 "2024-10-09T19:08:38Z")

</div>

Hi Connor! Thank you! I just checked out the demo project, and that one works nicely. Thanks for sending that!

The project has no instances of “StudioParameterTrigger” I’m trying to get working in WebGL - just moving the playhead from one clip to the next in Fmod 🙂 Is this possible in WebGL?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 10, 2024, 7:21am UTC](https://qa.fmod.com/t/unity-fmod-adaptive-music-in-webgl/22168/4 "2024-10-10T07:21:17Z")

</div>

Yes, it is possible.  
There are two options, setting the parameter on the emitter or using a FMOD Studio Parameter Trigger:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/99cf07512a624aa5175a41c4825315131301b2e0.png)  
[Unity Integration | Game Components - Studio Event Emitter](https://fmod.com/docs/2.02/unity/game-components.html#studio-event-emitter)  
[Unity Integration | Game Components - Studio Parameter Trigger](https://fmod.com/docs/2.02/unity/game-components.html#studio-parameter-trigger)

Hope this helps!
