Common.bnk

Started by Newmodder, August 07, 2017, 12:19:16 PM

Previous topic - Next topic
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!

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.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

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.

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?

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)

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.

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?

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.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

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.

so i type this:

swbf-unmunge -file common.bnk -mode "explode"  ;)

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.