AudioClips not playing in WebGL when downloaded with AssetBundles
Unity 5.2.3 or 5.3.1,
WebGL audio clips rom AssetBundles seems to be firing: “Error: Cannot create FMOD::Sound instance for resource archive:/CAB-…/CAB-…resource, (Unsupported file or audio format. )”.
These audio clips have no problem to be played when they’re part of the build, but produce the above fantastic error.
As it seems a number of issue has raising up regarding asset bundles derivatives I might do so (though this is certainly not ideally as it means more development time for the development environment only).
Marco, are you saying that WebGL assetbundles may not load properly in an editor (with WebGL platform targeted) ? Is this specific to audio or any assets?
Either way, is this not a bug? The Unity Editor should know how to download/process assetbundles for its current target properly. I dont recall having this issue with the webplayer platform.
I think it is and should be regarded as a bug.
Unity being able to give you the ability to test 90%+ of your work in editor is one of the biggest pluses of this platform.
If they are letting this loose, I think this will pile up to major difficulties and overhead to develop.
I already have an issue with a third party font plugin that does no work in the editor, basically making me unable to read anything printed in the game in editor mode. Needing to fix that is a horrible overhead.
I have at least one bug report on this issue from a shader/materials stand point and I believe there are others out there. I have not heard from QA regarding it, however.
I’m not sure that this should be regarded as a bug; the assetbundles for webgl (or for android/iOS) have very different compiled shaders and for webgl the audio is not played with FMOD but with the WebAudio API.
So that means that the editor should be able to mimic the behaviour of a browser to play the audio to have any meaning qua testing; or to play the game even, because the runtime behaves differently depending on the browser.
It’s better to build standalone assetbundles and use those in the editor. In fact, it might even be better to not use assetbundles in the editor at all.
I have to disagree. The main concern of the development is producing a certain flow of data to the player. The technical changes between each platform are irrelevant to that concern. This is the strongest point of what Unity is all about - best game cross-platform development in the market.
Yes. If you check “Platform compatibility for AssetBundles” table in the manual, asset bundles built for platform X might work in the editor but specific type of assets might not be compatible.
So, if you built a webgl asset bundle, and an asset fails to load in a webgl build, that’s definitely a bug. If it fails in the editor, it depends. For example, if a shader does not work in the editor that renders using DX9/11, then that’s expected.
Thanks for the response. I guess that is understandable but very disappointing for our workflow. That documentation should probably be updated with all current platforms, though, to note the incompatibilties.
I understand that is not convenient, especially if you were used to deploy to the WebPlayer, which did not have this problem. Maybe that’s something we can look at in the future, although it might be tricky. For example, in terms of audio assets, Unity WebGL uses AAC format which is not readable by FMOD.
@Marco-Trivellato could you tell us how the correct workflow should be for building assetbundles with shaders for Standalone which are compatible on Windows and OSX? There is a problem when using the Standalone assetbundles in the editor and we couldn’t figure out how to solve it yet.