Hey folks!
I’m having some difficulty with playing sounds from a downloaded Asset Bundle in our app, and I’m sort of at a loss as to what the issue could be. Right off the bat I want to say that we are probably using a less than common set up for our banks, but our sound designer doesn’t think this would be the cause of the issue.
As it stands, we have various banks for each Asset Bundle “pack.” Each pack contains a number of 3D assets which are loaded into our app, as well as our banks, which are stored on a prefab that loads the banks into memory when instantiated. We have each corresponding bank marked as a master bank in FMOD Studio so that they could then have a respective strings.bank, allowing us to load the path strings for a specific pack’s bank only when the user is using that pack. This should also allow us to update the banks by updating the Asset Bundle, rather than having to issue an update to our Master Bank and it’s corresponding strings.bank.
Furthermore, we have some globally used UI sounds in our Master Bank, which is included in all builds of the app. These UI sounds work as expected, and our sound designer has said that these sounds are sent straight to our Master Bus.
When loading the bank and strings.bank from the Asset Bundle, both load in correctly, but whenever the GameObject that contains a StudioEventEmitter is enabled, the allocated sound doesn’t audibly play. Interestingly though, FMOD doesn’t throw an error here saying that it can’t find the event by the supplied path and I can see the StudioEventEmitter.Play()
method is being called.
I also created a little utility class that I can throw on the GameObject at runtime, and it states that the StudioEventEmitter.IsPlaying()
value is true:
StudioEventEmitter eventEmitter = GetComponent<StudioEventEmitter>();
if (eventEmitter != null)
{
Debug.Log($"Event emitter playing? {eventEmitter.IsPlaying()}");
}
else
{
Debug.Log("Could not find event emitter");
}
I experimented by unmarking the banks as Master except for the Master Bank, and then loading in the bank by itself with the Master Bank.strings.bank from the AssetBundle. FMOD picks up on the fact that this strings.bank has already been loaded, and does not load it, but when the GameObject is enabled, FMOD throws an error at this point saying it can’t find the event. This seems quite strange, because the Master Bank.strings.bank included with the app should have reference to all our events.
EDIT: I just realized that the above paragraph isn’t actually an issue, what would be happening here is that the because the Master Bank.strings.bank was made when all banks have been marked as master and then loaded directly into Unity and not via Asset Bundle, it wouldn’t have references to the other banks (which is expected behaviour).
Furthermore, I’ve also experimented with unloading the already loaded Master Bank.strings.bank and then loading the strings.bank from the AssetBundle. Interestingly, FMOD does not throw the above error, but the sound still does not play. I would say this scenario lines up with the first in this message.
At this stage it doesn’t feel like an issue with loading in banks, and might be an issue with our set up? As far as I can tell, our workflow of having distinct master-marked banks is not an intended way to use banks. Looking at some of the documentation, the Master Bank is meant to contain the mixer for the FMOD project, so I wonder if this might be getting messed up by our method. Admittedly this is where my knowledge starts to get hazy, but our sound designer didn’t think this would be an issue and recommended we use the “every bank is a master bank” method.
Thanks for reading my long post, hoping someone experienced with this could give me a helping hand! Appreciate it (: