Sign in to follow this  
RageLeague

How to properly prepare and load an audiobank file?

Recommended Posts

RageLeague    1485

Now I am trying to figure out how to properly prepare and load audiobank files. I have already downloaded fmod studio and made a sample fmod project, like this:

image.thumb.png.bb7dd2d0ad2b9ffe5a5620e711a925ec.png

image.thumb.png.e0f2b7d0c2d834786602f45e3f5e896f.png

image.thumb.png.dd1b267feecfc8dd13d68f017cfeac42.png

(This is for a custom character theme music, but that's besides the point as I can't even load the bank file.)

After building the project, I got two files, Master.bank and Master.strings.bank

I put the two files somewhere in my mod folder and tried to load them using AUDIO:LoadBank, but only the Master.strings.bank is ever loaded to the game while Master.bank always fail to load. The error message is "failed to load DEMOCRATICRACE:assets/audio/Master.bank". I know that Master.strings.bank successfully loaded because I did DBG(AUDIO.sound_banks) and got this:

image.thumb.png.f21972265d8aa530c343001246d915a4.png

I tried both synchronous loading and async loading, and they both failed. So I'm wondering, is there anything special I need to do with the project before it is compatible with the game? The post above said something about "requiring a project file compatible with the game to build new banks", but I'm not sure what that means exactly. As long as the audiobank is loaded into lua, I can probably figure it out from there, but I'm not sure how to get there first.

Edited by RageLeague

Share this post


Link to post
Share on other sites
rooks    240

I attempted a similar thing as you a while ago, and the FMOD documentation along with this thread seems to indicate the project needs to be set up a particular way to be compatible with the main bank.  Unfortunately I got pulled onto other tasks and wasn't able to follow up, but if you come across any solutions it'd be great to know.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
RageLeague    1485

From the post listed above:

Quote

Often easiest way to achieve this is to make a copy of your project, strip out all the events, and then give that skeletal project to your players for them to create new events in.

That sounds like a good idea. Bank files can't be reverse engineered back to the original project file, so in order to have the structure be similar to the original bank file, I need at least a basic structure of the original project file.

Also, how is "engine.sound:LoadBank" implemented? Is it a function written by Klei or is it just calling part of FMOD's api? Right now, this function returns nil if a bank fails to load, regardless of reason, so I'm wondering if it can somehow give out a more detailed error message for debugging?

Share this post


Link to post
Share on other sites
RageLeague    1485

Looking at the log file(instead of debug console using ctrl+~), the error is something like this:

Quote

15:52.36-General: FMOD error! (28) An error occurred that wasn't supposed to.  Contact support.

When I am trying to load the main bank file. The string file worked fine. Not sure what happened here.

After some investigation, apparently fmod studio doesn't allow loading of multiple projects.

https://qa.fmod.com/t/loading-multiple-banks/15185

Which a solution is linked here:

https://fmod.com/resources/documentation-studio?version=2.0&page=supporting-downloadable-and-user-generated-content.html

Either way, it seems that you need to provide a copy of the project, or a packaged copy if you don't want the player to edit specific contents.

Edited by RageLeague

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this