RuntimeManager.LoadBank fail

in unity 2021.3.16f1

BankLoadException: [FMOD] Could not load bank ‘J:/FMODProject/Genesis/Build/Desktop/SFX.bank’ : ERR_INVALID_HANDLE : An invalid object handle was used.

int maxchannels = 128;
RuntimeManager.StudioSystem.initialize(maxchannels, FMOD.Studio.INITFLAGS.NORMAL, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
TextAsset bankAsset = ResMgr.Instance.LoadSync<TextAsset>("Assets/Res/Sound/Fmod/SFX.bytes", out var outAREx);
RuntimeManager.LoadBank(bankAsset);

Hi,

What version of FMOD are you using? I will link to our documentation on the subject under Unity Integration | User Guide - Asset Bundles and Addressables.

This indicates that there might be an issue with the TextAsset you are passing into the LoadBank() function.
Could you try the following code:

Load Bank Assets
void Awake()
{
	var assetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "banks"));
	if (assetBundle == null)
	{
		Debug.LogError("Failed to load AssetBundle!");
		return;
	}

	foreach (var name in assetBundle.GetAllAssetNames())
	{
		FMODUnity.RuntimeManager.LoadBank(assetBundle.LoadAsset<TextAsset>(name));
	}

	Debug.Log("Succesfully loaded assetBundle");

	assetBundle.Unload(false);
}

Using that make sure the banks .bytes file is marked as so:
image
Hope this helps!

int maxchannels = 128;
 RuntimeManager.StudioSystem.initialize(maxchannels, FMOD.Studio.INITFLAGS.NORMAL, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
TextAsset bankAsset = ResMgr.Instance.LoadSync<TextAsset>(Common.RES_ROOT_PATH + "Sound/Fmod/SFX.bytes", out var outAREx);    //bankAsset.text is bank stub:SFX
RuntimeManager.LoadBank(bankAsset);

I feel something wrong

Hi,

Could you elaborate on the issue? Are you still getting the same error as the original post?

I still getting the same error as the original post
help