# Does WebGL support spatialized audio?

**URL:** <https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148>\
**Category:** FMOD Engine\
**Created:** [September 8, 2020, 4:07am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148 "2020-09-08T04:07:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 8, 2020, 4:07am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/1 "2020-09-08T04:07:13Z")

</div>

Hi guys,

Pretty simple question here. I’m working on a project for a client and the key technical components are that spatialised audio is utilised and that the project is able to be embedded into a website.

In the current Unity project (using Unity 2018.4.26f1 and FMOD Studio 2.00.10) I am able to get a functioning bounce into WebGL, but without any of the spatialised audio I have made in FMOD. The project is muted.

When I took off the spatialiser plugin and tried a build, I had the same outcome - no audio from FMOD.

The audio files I have within my event are 1st order ambisonic tracks that I have bounced from Reaper.

 ![Screen Shot 2020-09-04 at 12.34.08 pm](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/cc74f36d36a55a745c5cb6f1ea455076698c2ebe.png)

Is this why I’m not getting any audio? Because WebGL doesn’t support ambisonic audio files yet?

I have read about mentions of an API for a WebGL build with FMOD, but that has gone over my head a little bit on the technical front.

Any help would be greatly appreciated. If WebGL isn’t the solution, does anyone know of a way to embed a Unity project with spatialised audio into a website?

Cheers,

- Tom

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 8, 2020, 6:12am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/2 "2020-09-08T06:12:45Z")

</div>

FMOD doesn’t natively support Ambisonics, support is derived by using the Resonance or Oculus spatialization plugins. Unfortunately these plugins aren’t available for WebGL, they would need to be ported over. I can log a feature request for Resonance to be port, for Oculus you’d need to contact them for availability.

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 8, 2020, 6:39am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/3 "2020-09-08T06:39:33Z")

</div>

Hi Mathew,

Thanks so much for your very quick response!

Initially I was using the Resonance Audio plugs for ambisonics. Then I switched over to the native FMOD Spatialiser plugins for that reason, assuming that the native plugins achieved the same effect? Unless they do something different?

I’m also assuming that a feature request would take a few months at least to be implemented if WebGL would want to go ahead with it?

Thanks again for your time.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 10, 2020, 2:34am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/4 "2020-09-10T02:34:57Z")

</div>

The FMOD native spatializer will interpret 1st order Ambisonics as a 4 channel (quad) audio file (not what you want). You must use a plugin that supports Ambisonics to get the desired result. Getting Resonance working on WebGL is not a trivial task and in-fact impossible with its current architecture (it uses threads which aren’t available on the web). Unfortunately I don’t see a way forward for you using WebGL and Ambisonics.

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 10, 2020, 5:54am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/5 "2020-09-10T05:54:45Z")

</div>

No worries. Thanks for that info.

Does the ‘quad’ audio format work for a WebGL bounce? I’m getting some errors in my build attempt, which I’m not sure are FMOD related.

Cheers,

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 10, 2020, 7:03am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/6 "2020-09-10T07:03:53Z")

</div>

Quad should work fine in WebGL, it’s just a four channel audio file, should work as well as stereo or 5.1 for that matter. What errors are you getting?

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 10, 2020, 7:26am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/7 "2020-09-10T07:26:08Z")

</div>

Beauty. Here are the errors I’m getting:

 ![Screen Shot 2020-09-10 at 5.25.22 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/abdb9e449888073f18dec2e241751e65e1a69714.png)

Cheers,

- Tom

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 10, 2020, 11:19pm UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/8 "2020-09-10T23:19:17Z")

</div>

Could you press the little “three vertical dots” button in the lower right of the main scene view and click “Open Editor Log”, then send the contents of it? Hopefully that will give some more detail than the image provided.

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 11, 2020, 12:15am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/9 "2020-09-11T00:15:31Z")

</div>

No worries. Here is the editor.log

Hopefully it’s not too hard to sift through!

Thanks again for your time in helping me out with this

Cheers,

- Tom

[Editor.log](https://qa.fmod.com/uploads/short-url/ae0LnP3e8QZDfVajfnZ83xlU5P5.log) (149 KB)

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 11, 2020, 1:42am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/10 "2020-09-11T01:42:22Z")

</div>

The relevant error appears to be:  
`stderr:error: Linking globals named '_ZTVN4FMOD19AsyncCommandPrinterE': symbol multiply defined!ERROR:root:Failed to run llvm optimizations: `

It sounds like you might be linking FMOD twice, possibly the “L” logging and non logging version?  
Check the settings for libfmodstudiounityplugin.bc and libfmodstudiounitypluginL.bc and make sure you aren’t using both (one or the other). See our [docs](https://fmod.com/resources/documentation-unity?version=2.1&page=platform-specifics.html#fmod-libs-on-static-platforms) for how to switch static libraries on and off.

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 11, 2020, 2:52am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/11 "2020-09-11T02:52:43Z")

</div>

Hi Mathew,

Okay great. That has gotten a consistent successful build out of Unity, so thank you for that!

There is still no audio coming through, though…

I have switched between applying the libfmodstudiounity plugin and libfmodstudiounitypluginL when building and neither produce sound in the build.

Is there anything in my FMOD settings in Unity that I am doing wrong?

 ![Screen Shot 2020-09-11 at 12.47.18 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/897ffd4f40cba35fad01849410f11a9367d51eb2.png)

 ![Screen Shot 2020-09-11 at 12.47.26 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/adfcd43049fa1c3a5f294323abdde74aa77d14e0.png)

All I have in my FMOD session is the three 4-channel audio files with an FMOD spatializer on the master.

I get audio in both FMOD and Unity, just not in the build.

Cheers,

- Tom

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 11, 2020, 3:30am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/12 "2020-09-11T03:30:01Z")

</div>

Is it possibly because WebGL is single threaded, so it is having trouble with some of the parameters I have in my FMOD project? I have 3 parameters in my project which change the sound depending on the horizontal + vertical orientation and whether the player moving or not.

Cheers,

- Tom

 ![Screen Shot 2020-09-11 at 12.47.18 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/897ffd4f40cba35fad01849410f11a9367d51eb2.png)

 ![Screen Shot 2020-09-11 at 12.47.26 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/adfcd43049fa1c3a5f294323abdde74aa77d14e0.png)

---

<div class="post-metadata">

**Author:** ![FishEyes95](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@FishEyes95](https://qa.fmod.com/u/FishEyes95)\
**Post date:** [September 21, 2020, 9:35pm UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/13 "2020-09-21T21:35:00Z")

</div>

Hi Mathew,

Just double checking whether you received my last email?

Cheers,

- Tom

 ![Screen Shot 2020-09-11 at 12.47.18 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/897ffd4f40cba35fad01849410f11a9367d51eb2.png)

 ![Screen Shot 2020-09-11 at 12.47.26 pm.png](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/adfcd43049fa1c3a5f294323abdde74aa77d14e0.png)

---

<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:** [September 22, 2020, 12:55am UTC](https://qa.fmod.com/t/does-webgl-support-spatialized-audio/16148/14 "2020-09-22T00:55:41Z")

</div>

does your browser session have an interaction? Chrome audio won’t allow audio unless it is triggered from a mouse / finger interaction.

[No sound in Unity WebGL build](https://qa.fmod.com/t/no-sound-in-unity-webgl-build/15900/4) should provide context.
