Errors loading audio using WebGL

It seems audio doesn’t play on WebGL when loaded from an externally hosted assetbundle.
"Error: Cannot create FMOD::Sound instance for clip "audioName" (FMOD error: Unsupported file or audio format. )"

There are some old forum posts with this issue from pre-addressable, but none contain solutions that work today.

Is this a known bug?

Update - this is true both in Editor on 2020.1, and in both Editor and WebGL builds on 2020.2.0a
Notably, the load state of the clip after loading it via addressables is AudioDataLoadState.Unloaded, and trying to fix that with audioPlayer.clip.LoadAudioData causes the same error.

My best guess is that we’ve walked into a bug in the assetbundle system as described here:

If someone from Unity could confirm that would be great!

Using this same set up I encountered this issue. Loading an Addressable AudioClip through a RemoteLoadPath on WebGL throws this FMOD error.

Did you manage to solve this issue?

I think we did, although I can’t recall what we did. Here’s our code -

1 Like

I used this bit of code, and the code I was origially using, but am still running into issues with it being unable to load any AudioClips.

I have moved past the “Unsupported file or Audio format” error by adjusting some of the import setting so I think I’m going in the right direction.

I see that you posted on another forum which you seem to have encountered this next error. Do you remember how you solved the following error?

Failed getting load state of FSB

I don’t, sorry! It was a while back, I think we just messed with settings until it stuck :confused:

1 Like

We’re getting Failed getting load state of FSB again now too! It seems to be editor only but it’s still very annoying.
Anyone able to comment?

This thread implies that we’re unloading the asset, but I really don’t believe that we are!

I’ll ping the team, see if they have any insight or guidance they can pass along.

Hmm would you mind submitting a bug report with a repro project? I’d be interested in seeing the call stack.

    IEnumerator GetAudioClip()
    {
        using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("https://www.the3rdsequence.com/soundb/data/sounds/55/55.ogg", AudioType.OGGVORBIS))
        {
            yield return www.SendWebRequest();

            if (www.isNetworkError)
            {
                Debug.Log(www.error);
            }
            else
            {
                myClip = DownloadHandlerAudioClip.GetContent(www);
                audioSource.clip = myClip;
                audioSource.Play();
                Debug.Log("Audio is Playing");
            }
        }
    }

Hi, I am getting the same error in Webgl build, but I am not using asset bundle, I am just accessing a link that contains a sound file. The error is the same -
“Error: Cannot create FMOD::Sound instance for clip “audioName” (FMOD error: Unsupported file or audio format. )”. Is this a bug in Unity or am I doing something wrong?

@unity_waiIJd6fbNxk4Q I believe .ogg isn’t supported for WebGL builds because the format is not universally supported across browsers. Can you try loading the files as .mp3?

Then what will be the AudioType?

Hi @Reshad I just double checked with the WebGL team, and the WebGL platform utilizes the built-in audio support codecs available in web browsers. The different types of audio that are supported can be found here

@inkletom I was able to reproduce the “FMOD error: Unsupported file or audio format.” errors when loading audio files from WebGL AssetBundles in the Editor. But in the Player, the audio files load perfectly fine. I’ve created a ticket to investigate the issue.

Here’s the versions I used:
Addressables 1.18.16, 1.19.6
Unity 2020.3.15f2

I couldn’t reproduce the “Failed getting load state of FSB” error, but I suspect whatever is causing the different behavior in the Editor vs the Player is related.

We are now seeing "Loading FSB failed for audio clip ____ " in Safari 15. This appears to be limited to Safari 15 on macOS 10.15.x, but is encountered for Unity versions from 2020.3 back to 2018.x. And for audio clips which are in the build & those loaded from www/xhr at runtime. All of our audio files are mp3

Browser console errors:

For others, we’ve reported here and it appears likely to be an issue w/ MP3 decoding in Safari 15 on macOS 10.15 231449 – REGRESSION (Safari 15): AudioContext.decodeAudioData() fails to decode MP3 on macOS 10.15 (Catalina)
Probably a separate issue than the one originally reported in this thread, apologies

@pillakirsten Hello! I’m seeing this exact issue and could not find the ticket you were referring to in the Issue Tracker (if that is the right place to look). Could you please let me know if this was resolved?

@jinjerie Hmm it’s an internal ticket that’s been closed as not reproducible “Unable to repro with latest addressables, even in the case the user mentioned on mac with Safari. Was able to see AAC audio files indeed cannot be loaded directly”.

If you’re still able to reproduce the issue on a newer version, please send us a bug report