Android/IOS Error, ERR_FORMAT : Unsupported file or audio format

There is error issue in mobile platform (android, ios) After upgrade “Unity For FMOD” Asset (ver 1.02.09 → ver 1.02.11)

I use to Bank Import Type AssetBundle
And Unity version 2021.2.4f1

The Error is below

Type : Exception
Main Thread ID : 1
Time : 8.032796
Condition : BankLoadException: [FMOD] Could not load bank 'Master' : ERR_FORMAT : Unsupported file or audio format.
Stack: FMODUnity.RuntimeManager.LoadBank (UnityEngine.TextAsset asset, System.Boolean loadSamples) (at <00000000000000000000000000000000>:0)
SoundManager+<>c.<LoadBank>b__17_0 (AddressableAsset`1[T] textAsset) (at <00000000000000000000000000000000>:0)
AssetManager+<>c__DisplayClass6_0`1[T].<GetAsset>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] op) (at <00000000000000000000000000000000>:0)
System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
DelegateList`1[T].Invoke (T res) (at <00000000000000000000000000000000>:0)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Complete (TObject result, System.Boolean success, System.Exception exception, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0)
UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[TObject].ProviderCompleted[T] (T result, System.Boolean status, System.Exception e) (at <00000000000000000000000000000000>:0)
UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle.Complete[T] (T result, System.Boolean status, System.Exception exception) (at <00000000000000000000000000000000>:0)
UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider+InternalOp.CompleteOperation () (at <00000000000000000000000000000000>:0)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <00000000000000000000000000000000>:0)
DelegateList`1:Invoke(T)
UnityEngine.AsyncOperation:InvokeCompletionEvent()

I suspected the problem with this error was 1kb files.

is relative with files that Error? or is there other issue?

It looks like your bank.asset.bytes files are still stub assets, which is why they are so small in size. Are you calling EventManager.UpdateBankStubAssets(buildTarget); when building asset bundles?

i dont call EventManager.UpdateBankStubAssets , also i couldnt find to use EventManager.UpdateBankStubAssets function in my project.

Asset bundles need to be manually built in Unity. If you look through the AssetBundle workflow Unity Documentation you will see that there is a stage where you need to call BuildPipeline.BuildAssetBundles. To make sure that asset bundles have the correct text assets in them you need to call these two functions as well:

EventManager.CopyToStreamingAssets(buildTarget); // 1

BuildPipeline.BuildAssetBundles(Destination, BuildAssetBundleOptions.None, buildTarget);

EventManager.UpdateBankStubAssets(buildTarget); // 2

Thanks apply

I used to be manually bulit Asset bundles In my Project. also use the BuildPipeline.BuildAssetBundles Function,

I will try to use EventManager.CopyToStreamingAssets Function and EventManager.UpdateBankStubAssets what you say When manually build AssetBundles.

I will give you feedback

1 Like

@shj6078 Were you able to resolve the issue? We are currently facing the same issue with unity update.

What version of FMOD and Unity are you using?
Can you please tell me how large your .byte files are after building, and whether you are seeing them change size at all while building?

Still facing the same problem after updating to 2.02.24… will this be fixed one day? Really frustrating.

What is the issue that you are having?
Have you followed the information in our documentation for AssetBundles & Addressables?

Here are some more info about this issue.

First, our use case might a bit unusual. In a nutshell:

  • our Master bank is attached to a gameobject in our main scene
  • we have other large local bundles (~1GB) built separately, containing audio banks (to be uploaded as expansion files to the Meta Quest store along with the APK)
  • and finally, we have many small and big bundles (also containing banks) that we upload to our CDN.

All our banks resides inside an Assets/Audio folder. Because we don’t want any of them to be included in the APK, we don’t want then to live inside the StreamingAssets folder. For this reason we set FMOD settings to AssetBundles allowing us to specify “Audio” as our “FMOD Asset Sub Folder”.

I spent some time figuring out what was really happening and it seems like the issue is CopyToStreamingAssets() exits early because Settings.Instance.ImportType is set to AssetBundle. As a result, our APK embeds a Master.bytes 1kb stub asset instead of the full bank which indeed leads to the "unsupported format’ error.

So our current workaround is to edit EventManager.cs and return any call to UpdateBankStubAssets() so stub assets never get used. But indeed everytime we update FMOD for Unity, we must remember about that hack again, which is cumbersome.

FYI we recently had to deal with an emergency where our app in prod was hard crashing when using the headphone jack headset input after the Meta Quest OS switched to an higher version of Android. Upgrading from 2.02.22 to 2.02.24 fixed the issue.

Hope that helps. Please let me know if that makes sense.

The steps listed in Building AssetBundles need to be done outside of the build process otherwise, as you mentioned, CopyToStreamingAssets will exit early.

I have added a task to clarify that these steps should be done outside of the build process, and also investigate if there is a better way to handle this to then allow it to be done as part of the build.