Hey guys,
I’m trying to load an FSB sound bank direct from memory and it doesn’t seem to work.
In my project I have an fsb file called bank.fsb and it resides inside the Resources folder.
At the beginning I was loading the file via system.createSound(Application.dataPath + "/Resources/bank.fsb", MODE.LOOP_OFF | MODE._2D, out soundbank);
and it was loading and creating the sound instance without any problem.
Right now I’m saving my fsb banks inside Asset Bundles and trying to create sound by passing the file bytearray but the createSound method does not recognize the bytearray.
In order to illustrate the main problem (without using asset bundles and so) I renamed the file in the Resources folder to bank.fsb.bytes
to be recognized as binary and I’m loading and trying to create the sound instance with the code below:
var text = Resources.Load("bank.fsb") as TextAsset;
CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO();
var result = system.createSound(text.bytes, MODE.LOOP_OFF | MODE._2D, ref exinfo, out soundGroup);
UnityUtil.ERRCHECK(result);
As result I get an error saying:
FMOD Error (ERR_FILE_NOTFOUND): File not found.
Any thoughts about this problem?
Thanks in advance.