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.
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?
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.
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?
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.
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?
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.
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 for how to switch static libraries on and off.
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.