Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Loading Banks from mounted OBB files on Android

0 votes

This question relates to a Unity Project using C#, it is multiplatform but this issue is with Android specifically. Wwise version: 2017.1.0.6302

The audio for the game I'm working on has just increased in size surpassing the apk limit. I'm already using the OBB file to store videos and I make this OBB with the JOBB tool and mount it when the app starts. Note that this is different to using the split APK option in Unity, which ties the APK and OBB file together in a way that requires you to always update both.  

I've edited my build script to pull the audio files into the OBB alongside the videos and it successfully mounts as before. I've edited AkBasePathGetter.GetPlatformBasePath to return the correct location of the banks in my project (the mounted directory).  

I can see that the sound engine initialises successfully but Init.bnk, and one other bank file, both fail to load. I have wwise set to Debug but it still never prints where it is actually looking for the Bank files. 

I am wondering if anyone has done anything like this successfully? Can I get away with editing the path for this one platform or do I need to implement a Bank load which isn't going through the DLL (like AkMemBankLoader)?  

I've looked and a few people have asked about this over the years but the questions I found don't have answers. I can see people discussing AK_LOAD_BANK_IN_MEMORY but no hits are returned in the documentation for that when I search and I can't see anything in wwise settings that relates to this. 

Any help is much appreciated! 

asked Feb 1, 2018 in General Discussion by Lizi A. (180 points)
Update following today’s investigations:
The Bank and wem files are present in the OBB mount directory. I have confirmed that the path I’ve given the system is correct and File.Exists returns true for these files. Initialisation succeeds but it fails to load Init.bnk. I’m trying to answer the following questions:
Does this mean that Initialisation finds the Bank and decodes them but I am looking in the wrong place for the decoded files? Can I even control where it is looking for this file? I really wish LoadBank was printing the path it is using.  
Is it trying and failing to decode the files locally to where they are stored? It will fail if it is trying to do this because you can’t write to the mounted directory (because it’s a file).
Is there no separation within wwise of the encoded base path and the decoded base path, so I currently cannot separate these out and have different base paths for these two places? Only one base path is set and then Init fails to load, is it – in this case – just loading the file into memory without decoding it? Or is it trying to decode to a location is cannot write to? Or is it actually failing to find the files like it says, despite the fact that the file is definitely there?

Using AkBank component to load Bank:
I can see that a BankHandle is created in AkBankManager but decode is false so it skips most of the work in that class’s LoadBank function. However, when decode is set to false, relativeBasePath is not set and therefore the load doesn’t do anything (the logic skips LoadAndDecodeBank which doesn’t seem correct, it basically skips all Load logic if this isn’t set). With this value set the file is still not found, however, I can’t see in this case where LoadAndDecodeBank is actually looking because that is buried inside the DLL.   

Using AkMemBankLoader component to load Bank:
I have managed to edit it so that the WWW finds and loads the file, however, it then fails the first test and I do not properly understand what it is checking here, I understand it is checking to make sure particular bits are set I just do not know why or what I can do to affect the data alignment of the Bank file.
if ( (ms_pInMemoryBankPtr.ToInt64() & AK_BANK_PLATFORM_DATA_ALIGNMENT_MASK) != 0 )

Please sign-in or register to answer this question.

...