Error playing audiosource in WebGL using Unity 2022

Our project
Unity 2022.1.23f1

Things were going well as we started adding audio to our project, but we recently started getting this error when we tried to call Play() on any AudioSource.

FMOD returns error code 36 (FMOD_ERR_INVALID_HANDLE) executing setRelativeAudibility

I have tried updating to Unity 2022.2.1f1, but i still get the error.
Funny thing, when I went back to 2021.3.16f1, I stopped having that issue and everything seems fine. Is there something different in 2022 that I need to account for when using Audio in WebGL? We are currently just using mp3 files.

The AudioSource component is made by Unity, but their built in audio does happen to use an older version of FMOD that is heavily modified these days.

We have a separate plugin, FMOD for Unity, that users can add to their project to use our audio engine instead of the one built in to Unity. We can help you if you are using our integration, but if you are having issues with the AudioSource component I would suggest reaching out to Unity on their forums.

Hi, we are also seeing this error and interested in looking at the plugin. I downloaded it and installed. But there are appears to be a LOT of work that needs to be done to use the FMOD audio engine. Is that correct? Is there a way to use the FMOD audio engine as a straight substitute for the built in Unity components, but without having to upgrade/change the audio listeners and the audio sources?

It is possible to use the bare FMOD Audio Engine with Unity, although our FMOD for Unity plugin handles all the integration for you.

We have an extensive Getting Started guide that details all the steps to getting FMOD for Unity up and running, as well as a number of advanced topics that may or may not be useful to your application.

I saw the guide, but it is not clear to me how to integrate things if you are not using the Studio and you don’t have any banks. Can I use a Unity project the way it is (with Unity Listeners, and Unity Audio Sources) or do I need to upgrade them to use the FMOD ones?
Do I need to use banks ?

If you want to use the FMOD Core API alone, you can still use the FMOD for Unity integration if you like (although there will be a lot of unused things in there). ignore the setup wizard instructions and the FMOD Settings in Unity, you will have access to the FMOD API through our C# wrapper which should mirror the C API.

Otherwise you could choose to manually import just the Core API files yourself, which you can get from the engine download:

  • fmod.cs
  • fmod_dsp.cs
  • fmod_errors.cs
  • libs for your platform/s