SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF2 Modding => Topic started by: Newmodder on August 07, 2017, 12:19:16 PM

Title: Common.bnk
Post by: Newmodder on August 07, 2017, 12:19:16 PM
Hi forums!

How does one extract sounds from common.bnk?

Ok so before anybody shouts at me, yes i know there are links with extracted common.bnk file. But i want to learn to extract them myself. How would i do?

Thanks!
Title: Re: Common.bnk
Post by: Giftheck on August 08, 2017, 04:03:51 AM
The way SWBF2's common.bnk was extracted was that somebody loaded the raw data into Audacity. From there you'll have to pick apart the sounds manually.
Title: Re: Common.bnk
Post by: RepComm on August 08, 2017, 05:31:07 AM
I'd be willing to bet that the format would be simple enough to crack with a hex editor.. my guess is a series of sample lengths and then the full sound samples all crushed together with no spacing. I'll have a look later.
Title: Re: Common.bnk
Post by: Newmodder on August 08, 2017, 11:19:47 AM
Thanks guys!

Quote from: Gistech on August 08, 2017, 04:03:51 AM
The way SWBF2's common.bnk was extracted was that somebody loaded the raw data into Audacity. From there you'll have to pick apart the sounds manually.

So should i either:

A. import the .bnk directly into audacity?

or

B. extract the file then load it into audacity, if so is there a tool i can use?
Title: Re: Common.bnk
Post by: RepComm on August 08, 2017, 01:08:14 PM
There isn't a tool that I know of, but I was suggesting the creating of a tool. I'm going to be messing with it when I get to some other tools after work.

If you're itching to do it now, you'll have to use Audacy and choose RAW import. I've tried it a few times in the past with minimal success as I didn't know the encoding (endian-ness) or bit rate ( I think it's documented in some modding sound guide by psyc0fred)
Title: Re: Common.bnk
Post by: SleepKiller on August 08, 2017, 07:10:38 PM
Here's the basic structure of a sound bank chunk from what I observed the other day. I didn't go much deeper than this, but maybe this knowledge can help someone. (Or more specifically maybe it can help Newmodder and RC to some extent.)

-Parent Chunk
   -Data chunk holding the metadata for the sounds in the bank. Their hashed name, sampling rate, etc. Loading this into Audacity will probably make it yell at you.
   -Data chunk holding the sound data itself. This is what you can likely load up and read from Audacity.

If you want an easy way to get the contents of the second data chunk you can use this swbf-unmunge Explode mode (https://github.com/SleepKiller/swbf-unmunge/wiki/Explode-and-Assemble).
Title: Re: Common.bnk
Post by: Newmodder on August 11, 2017, 10:19:38 AM
Ok sleepkiller,

If i dont care about the names of the audio, i just want to import it i assume i use explode and assemble like you said. if so how do i use it?

Also Will the sampling rate make a difference?
Title: Re: Common.bnk
Post by: Giftheck on August 12, 2017, 05:58:11 AM
Sounds in the original games are stored in a number of different sampling formats ranging from 11kHz to 44kHz.

When I needed to extract the SWBF common.bnk, I used a command-line tool that was released on this thread: http://zenhax.com/viewtopic.php?f=6&t=2268

I can't guarantee this will work with SWBF2's common.bnk, though. If it doesn't, your best bet is to make a thread on ZenHax and ask the creator of the tool to see if he would be willing to upgrade it to extract from SWBF2's common.bnk.
Title: Re: Common.bnk
Post by: SleepKiller on August 12, 2017, 07:53:13 PM
Quote from: Newmodder on August 11, 2017, 10:19:38 AM
Ok sleepkiller,

If i dont care about the names of the audio, i just want to import it i assume i use explode and assemble like you said. if so how do i use it?
You follow the link and learn how to explode the ucfb files. Beyond that I've posted pretty much all I know about this. I can be of no further help I am afraid.
Title: Re: Common.bnk
Post by: Newmodder on August 13, 2017, 09:39:13 AM
so i type this:

swbf-unmunge -file common.bnk -mode "explode"  ;)
Title: Re: Common.bnk
Post by: SleepKiller on August 13, 2017, 06:48:11 PM
Quote from: Newmodder on August 13, 2017, 09:39:13 AM
so i type this:

swbf-unmunge -file common.bnk -mode "explode"  ;)
Test it and find out! Your best bet for being able to do this is learning how to problem solve in relation to stuff like this.
EhPortal 1.34 © 2024, WebDev