SRTT bnk_pc file - audio/music IDs

I worked on reverse engineering the bnk_pc file formats a while back, and while I got most of the features I wanted out of it, I could never get around to adding brand new audio clips to the game. After some extracting, I found that the clips have an ID of some sort, but I could never figure out where they're referenced from anywhere else in the game files.

Some of the xtbl files for things like radio stations have audio clip IDs, but they only reference audio files by name (like "SWIM_BLACK_MOUNTAIN___LET_SPIRITS_RIDE" for example) instead of the 32-bit number ID in the bnk_pc files. I found out that this ID was a hash for voice clips (a custom one I think), but the same hash didn't work for song names.

Also, the IDs/hashes for music clips seem to be restricted 30-bits instead of a full 32-bits (0 - 0x3FFFFFFF instead of 0 - 0xFFFFFFFF). Any idea why that is?

My code/research:
https://github.com/ToadKing/bnk_pc_extractor/
https://github.com/ToadKing/bnk_pc_extractor/blob/master/bnk_pc.h
 
The hash is some Wwise magic, so I can't really tell you much about that. Most of the audio is played by hard coded values in the game. We know the teleport sound is id X, so we just say play id X. You should be able to easily replace audio, but adding more events so you can play multiple sounds to say, the teleport sound probably can't happen.

I can totally see something like adding a new weapon and adding sound for that weapon though.
 
Aw, that sucks.

we've been able to replace audio for a while now, so at least we can do that. plus the radio station stuff seems to be almost entirely through xtbl files so we can always just butcher existing radio songs and use those
 
There could be options in the future for creating your own run-time objects via lua and that would allow for some stuff as well.
 
Would it be possible to get a file spec for bnk_pc files? I've figured out most of them but there are some remaining things I'm not sure about and the DMAV (at least that's the magic number for them) sections for voice clips have a big chunk that I don't know anything about. I assume it's lipsync stuff, but don't know more than that.

Also, why are all the subtitles listed twice? And what's with the three entries that are always empty? Cut languages?
 
Would it be possible to get a file spec for bnk_pc files? I've figured out most of them but there are some remaining things I'm not sure about and the DMAV (at least that's the magic number for them) sections for voice clips have a big chunk that I don't know anything about. I assume it's lipsync stuff, but don't know more than that.

Also, why are all the subtitles listed twice? And what's with the three entries that are always empty? Cut languages?

Bank files are just Wwise soundbanks, I'm not sure if we have that header. I thought Wwise had a free version available for use that could read that stuff, but maybe I'm wrong. The VAMD file is the Volition Audio Meta Data and has lipsync and subtitle information in it as you suspect. Header for that file:
uint32 signature
uint32 version
uint32 persona_id
uint32 voiceline_id
uint32 lipsync_size
uint32 lipsync_offset
uint32 subtitle_size
uint32 subtitle_offset
uint32 wav_length_in_ms

Looks like lipsync data is a series of uint16's for phoneme's(it also looks like it is "temporarily disabled"?):
first byte - upper four bits is energy - to decode, add 1 and multiply by 6
first byte - lower four bits is phoneme, values should have been set in the voice editor
second byte is duration in multiples of 30ms
Subtitle data header:
uint32 english length
uint32 english offset
uint32 german length
uint32 german offset
No idea why it is just two languages, I see a todo in code that suggests we need to expand this for other languages...German appears to not be processed. It uses some sort of a histogram to compress the subtitles, but all the histogram files are hard coded to RF4 values. I'm not sure if this stuff is used or not yet. I'll ask the audio guys when they get back from lunch to make sure I'm not just looking at old tools. :)
 
It appears there's two types of files with the .bnk_pc extension. One appears to be Wwise stuff (at least a quick search says so, ones with "BKHD" magic numbers). But there are also files usually with "_media" tacked on to the end of the name, and those look like something Volition specific ("VWSBPC<space><space>" magic number). Those ones have all the actual audio samples in them, which are just Wwise's wav files, and VAMD files for voiceclips. Also .mbnk_pc files which are just the VWSBPC files with all the actual soundclips/voice data removed (only in the soundboot archive).

Also, there are definitely more than two languages in the subtitles section. I've decoded some using the charlist_* files from somewhere (forgot where) and the appear to be complete for spanish/italian/russian/korean/japanese/etc.

Complete list I found:
English
Spanish
Italian
Japanese
German
French
Dutch
Unknown (always empty)
Unknown (always empty)
Czech
Polish
Korean
Russian
Unknown (always empty)
 
Found something. It seems we have a different file for streaming audio soundbanks with our own header(should be _media files).

uint32 signature (VWSB)
uint32 platform
uint32 timestamp(lower 32 bits)
uint16 version
uint16 cruncher version
uint32 wwise bank id
uint32 header size(includes all file data)
uint16 num files

file data immediately follows header:
uint32 file id
uint32 offset from top of file
uint32 metadata length(subtitle, etc)
uint32 length
 
On SR3 there was support for different genders to have different subtitles (some languages change various aspects based on the gender of the speaker) however this was never used to my knowledge so instead the data was duplicated.
 
Back
Top