Call out to modders/toolmakers: decoding audio bank ID's

In my quest to add music to radio stations instead of merely replacing them, I've ran into a problem I can't figure out. Each sound file is stored in a .bnk_pc file, combined with a reference in the table audio_syncs.xtbl. The .bnk_pc files have a header that lists the audio bank ID, and each entry in the databank includes a piece of binary data I can't decode. I was thinking that this was the mysterious <wwise_id> scattered about all the audio tables, but it's not. I've performed several full resource scans for any references to that binary data and it is only referenced in the bank file and the bank header in soundboot.vpp_pc. This poses a problem: Without knowing how audio data in the tables is referenced to the audio banks, I can't format the audio bank files for custom music. The audio bank files themselves are referenced by their in-file ID's in audio_banks.xtbl, but the the "ID"'s for the individual audio files themselves are never referenced anywhere else in the game's resources. The IDs in the tables all share references across files, but I can't find the meaning of these IDs.

tl;dr: cannot find what files the <wwise_id>'s in tables reference. Data in audio banks looked promising, but looks completely unrelated. Need to find something somewhere that links the two. I have some documentation on the .bnk_pc file in my packer code: https://github.com/ToadKing/bnk_pc_extr ... c_packer.c (.mbnk_pc is just a copy of the header of .bnk_pc)
 
Update: After talking with gibbed, he was able to figure out the <wwise_id> entry in the audio tables are a simple FNV hash of the clip/event name, so those probably are not related to the extra data in the audio bank files. That probably means either the names are special and are referenced somewhere, or those are hashes of a different type, or of different data somewhere else.
 
Update on Wwise_Id: The ID is generated by a FNV hash of the name like before, but with some special cases. It converts the name to lowercase before hashing, and if the name has a category in it (like RADIO_INTROS:GENX_CALLIN_NEXT_GIRL has the category RADIO_INTROS), the intro is ignored. (So just "GENX_CALLIN_NEXT_GIRL" would be hashed in that case.)

Basic code for generating hashes (adopted from gibbed's tools code):

Code:
unsigned int hashFnv(char *input)
{
    unsigned int hash = 0x811C9DC5;
    int i;
 
    for (i = 0; i < strlen(input); i++)
    {
        unsigned int c = input[i];
 
        if (c == ':')
        {
            // for us, we reset the hash function at a colon
            hash = 0x811C9DC5;
            continue;
        }
 
        if ((c - 0x41) <= 0x19)
        {
            c += 0x20;
        }
 
        hash *= 0x1000193;
        hash ^= c;
    }
 
    return hash;
}

Now all that's left is to decode those sound bank entry IDs. They appear to be hashes of some sort, but for non-voice clips, the values all appear to be lower that 0x40000000, with the highest 2 bits always 0. Voice clips use the full 32-bits. Learning new things every day, hopefully someone can help me crack this.
 
Update: I've found that for voice audio banks, the number in the audio bank matches to the <Wav_id> field in various voc_*.xtbl files in misc_tables.vpp_pc. However, the rest of the audio bank files are still a mystery for now, but things are looking up!
 
I just signed up for this forum after following your guide to extracting sounds out of these files (I was looking for the in-game cell phone ringtone to use on my own phone). I'm a little more interested in modding for this game in general. It took me a while to sort through all the WAV files to find the ringtone because nothing I can tell is labeled. So where does the name (such as "GENX_CALLING_NEXT_GIRL") come from?

I started a spreadsheet where I can write down what each file is, i.e. interface_media_160.wav is the cell phone ringtone. Is this something the modding community would appreciate or is this just duplicating information that could be found elsewhere in the resource files that I don't know about?
 
I started a spreadsheet where I can write down what each file is, i.e. interface_media_160.wav is the cell phone ringtone. Is this something the modding community would appreciate or is this just duplicating information that could be found elsewhere in the resource files that I don't know about?

It would be extremely helpful and appreciated. I've already done just that for the radio station music:
http://www.saintsrowmods.com/forum/index.php?threads/custom-radio-stations-guide.2/page-5#post-1998
 
Ok, I'll keep working on it. Would it be a good idea to put this on Google docs? This way multiple people can make additions/corrections to the list and I think it would be more easily viewable/distributable than my excel file.
 
I just signed up for this forum after following your guide to extracting sounds out of these files (I was looking for the in-game cell phone ringtone to use on my own phone). I'm a little more interested in modding for this game in general. It took me a while to sort through all the WAV files to find the ringtone because nothing I can tell is labeled. So where does the name (such as "GENX_CALLING_NEXT_GIRL") come from?

I started a spreadsheet where I can write down what each file is, i.e. interface_media_160.wav is the cell phone ringtone. Is this something the modding community would appreciate or is this just duplicating information that could be found elsewhere in the resource files that I don't know about?
While a spreadsheet can be useful in the short term, I'm more interested in finding out how the names in the audio tables are matched up to audio bank entries. Once that's discovered, I can generate a list for that easily. Feel free to start on your list though, it could prove helpful. Google Docs should be fine for something like this.
 
Just a heads up: You might want to record the ID metadata for each entry too, since that is how the audio is identified, not their position in the audio bank. The Different audio banks are mostly just there for organization.
 
Back
Top