Hello, I’m having a problem getting audioClips in an assetBundle to work for a WebGL build,
i have exported the assetBundle for WebGL and im testing them in the editor.
The error I get is the following:
Error: Cannot create FMOD::Sound instance for clip “TRY_AGAIN_es-ES” (FMOD error: Unsupported file or audio format. )
UnityEngine.AssetBundle:LoadAsset<UnityEngine.AudioClip> (string)
FWIW I get this error with audio files from asset bundles in the editor, but they mostly work fine in stand alone builds. Troubleshooting this I discovered if I used Windows asset bundles for the WebGL platform in the editor the audio loads fine…in the editor. Those windows asset bundles don’t work for the webGL stand alone. Very weird.
WebGL is a special case for Audio in Unity - we actually hand most stuff off to the browser. This includes loading audio files, we put the file in a normal codec (AAC) and let the browser handle it, in the editor we have our own internal format and container. What is happening here is using WebGL assetBundles in editor asks FMOD (our internal system) to load an AAC, which it can not do.
They should 100% work in standalone builds, and if they do not it is a bug. In the editor we suggest using assetBundles for your editor platform.
OK, so are you saying there is absolutely no solution for streaming audio assets in WebGL via Asset Bundles?
You suggest using assetBundles for Editor Platform, i’m not sure what you mean by this. My concern is how do I stream Audio in my WebGL Builds?
With asset bundles I can break up my build which makes my initial load only 20MB but then Audio is broken if I stream it in via Asset Bundles. If include my Audio Assets which is part of my second scene, then my WebGL Build now becomes 40MB. So this is not ideal. What is a good solution here?
Asset bundles with AudioClips built for webGL will work for webGL, these same asset bundles will not work on the editor platform i.e going into PlayMode in the editor. The solution would be to have separate bundles for editor and webGL.
ASFAIK you should be able to stream in the AssetBundle, but just make sure its built for webGL.
Why do you keep mentioning editor when I am cleary talking about WebGL? Are you a forum chatbot or something? Your replies makes no sense.
Also I have already told you multiple times here asset bundles and audio assets is NOT WORKING, and all you are saying is that it should work and not offering any solutions. You must be a damn bot…
Can you confirm your exact issue here because I think we have lost focus:
are you trying to use asset bundles built for webGL in the editor/PlayMode?
if so this will provoke the error seen in the original post, it is asking Unity to load a raw AAC file which we only do on webGL. The solution is to have a separate asset bundle built for the editor platform when using the editor/PlayMode
are you trying to use asset bundles built for your editor platform in a webGL build?
This will not work, as it is asking the browser to load the Unity format(vorbis in FSB container). The solution is to have a separate asset bundle built for webGL when building for webGL.
are you trying to use asset bundles built for webGL in a webGL build?
this should work, if it does not it is a bug, please report it and we will look into it.
I am not a bot, actually a human working for Unity in the audio team trying to help.
are you trying to use asset bundles built for webGL in the editor/PlayMode?
No I am not…
are you trying to use asset bundles built for your editor platform in a webGL build?
No I am not…
are you trying to use asset bundles built for webGL in a webGL build?
Yes, I am… and it is not working!
Is it not possible for you to assist by trying this on your end and providing a solution? Reporting a bug to Unity Issue Tracker takes ages to get any response back from them.
The best way really is to report the bug, then it can be correctly reproduced, documented, prioritized and tracked for anyone else out there experiencing the same issue. Appreciate your comments on the time though - we feel the pain of not getting through these bugs fast too!