[Tool] FSB Extractor

AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
edited March 2013 in Modding

This is not exactly modding per se, but it does have to do with the files of NS2, so I thought I would share it here.

Description
I've written a small tool to extract the sound samples of FSB files, and I just recently made it compatible with the FSB5 format, which is what NS2 uses now.
I'm aware of the FMOD Designer program, but if all you need is to extract and play the music, then you don't really want to install a large program.

FSB Extractor - FMOD Sample Bank Extraction Tool
With the tool, you can display and extract the sound samples contained within an FSB file. FSB stands for "FMOD Sample Bank".
Supports the FSB3, FSB4 and FSB5 file formats. Currently, there might be a few issues with FSB5, but the basics should work.

This program was originally made to open the FSB files of "Dragon Age", but has since been expanded into a general FSB Extractor.

Official Site
http://aezay.dk/aezay/fsbextractor/

Direct Download
FsbExtractor13.03.09.rar - Support for FSB files with basic headers.
FsbExtractor13.02.11.rar - Proper FSB3 and FSB4 mode flags. Changes to how the WAVE header is written.
FsbExtractor13.01.13.rar - Properly detects FSB5 sample format, including Ogg Vorbis. Fixed a few errors.
FsbExtractor13.01.04.rar - Samples with same name no longer overwrites each other. Directory listing for other FSB files in same folder.
FsbExtractor12.12.20.rar - Support for command line parameters and detailed verbose logging.
FsbExtractor12.07.03.rar - It now fully supports all FSB5 files of NS2.
FsbExtractor12.06.29.rar
FsbExtractor12.06.26.rar
FsbExtractor12.06.15.rar
Post edited by Aezay on
Ahm, could you please pass me the last piece of that delicious nubcaek?
PaajtorWoehler
«1

Comments

  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members Posts: 152
    nice, this would probably work for most games that use fmod very useful.

  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members Posts: 1,731
    edited June 2012
    Btw, I was looking at this FMOD designer the other day, for example to add a new sound into the game.

    Don't you need the project file in addition to the fsb and fev files in order to do that ? Could we get it ?
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    QUOTE (simon kamakazi @ Jun 26 2012, 03:03 AM) »
    nice, this would probably work for most games that use fmod very useful.

    It does indeed. It was originally made to extract the music from Dragon Age Origins, then later, I found out that there are actually many games that uses FSB files, and it worked for those games as well. The FSB5 format which NS2 just switched to, has a quite confusing data structure, there are actually a few of NS2's files it cannot properly play yet.
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members Posts: 152
    QUOTE (Yuuki @ Jun 26 2012, 10:50 AM) »
    Btw, I was looking at this FMOD designer the other day, for example to add a new sound into the game.

    Don't you need the project file in addition to the fsb and fev files in order to do that ? Could we get it ?



    yes u would need the project file, ive let charlie know that this should be given out with the builds, he agrees, it just hast happened yet but it will, probably for version 1, ill also do a nice tutorial on how to get your own sounds into the game.


    cheers

    simon
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members Posts: 867 Fully active user
    QUOTE (simon kamakazi @ Jul 2 2012, 07:02 AM) »
    ill also do a nice tutorial on how to get your own sounds into the game.

    cheers

    simon

    Sounds great! I would love to see something like a video series covering most important stuff in FMOD.
  • beaglebeagle Join Date: 2010-12-04 Member: 75469Members, Reinforced - Shadow Posts: 35
    Anyone got a link to this that works??
  • beaglebeagle Join Date: 2010-12-04 Member: 75469Members, Reinforced - Shadow Posts: 35
  • uraganuragan Join Date: 2012-05-28 Member: 152677Members Posts: 6
    edited July 2012
    hi
    i cant download your tool,
    is it outdated?
    or, your website is offline?

    EDIT: Tool is online thx
    Post edited by Unknown User on
    online
  • snailerisnaileri Join Date: 2012-11-01 Member: 165480Members Posts: 12
    Nice tool! I extracted the exosuit's voices ("Initiating system").
    Is there a tool to build FSB5 files? I'd like to overwrite some of the origical sounds and make a sound mod.
  • countbasiecountbasie Join Date: 2008-12-27 Member: 65884Members Posts: 824
    Any news on the project files simon? I'd really love to look deep into customization, like randomization and pitching of sounds etc...I guess we need the project files for that?
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members Posts: 4
    Hi,
    It seems that Planetside2 uses FSB5 for it's audio but when i drop one of the files on it i get the following error:

    Access Violation at address 004506C0 in module
    'FsbExtractor.exe'. Read of address 00000004.

    The program doesn't crash, but if i then dump that file out the RIFF header looks fine but if i try and play it back in various programs it doesn't work, in foobar2k it gives me: Unsupported format or corrupted file.

    I can provide example files if you'd like.

    Many thanks,
    Intrinsic
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    Intrinsic
    Which program are you using to unpack the assets pack files of PlanetSide 2?
    After unpacking a few FSB data from the pack files using a hex editor, they seem to be stored in the ADPCM format, and there has always been issues with that format and getting it to play properly. I will advice using VLC for playing ADPCM format files.
    I'm interested in knowing how you made the program crash, which pack file and specific FSB file made this happen, all of them? Also, are you using the latest release, since I did fix a few errors in the one I put out a few days ago.
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • CarNagE1CarNagE1 Poland Join Date: 2003-05-14 Member: 16298Members, NS2 Playtester, Reinforced - Shadow, WC 2013 - Supporter, Subnautica Playtester Posts: 586 Advanced user
    I was just looking for a tool like this :) great!
    Thx
    imageimage image
    Main Editor of www.naturalselection2.pl
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members Posts: 4
    Heya,

    I am using the latest version: FsbExtractor13.01.04.rar

    I have a python(2.7.3) script which unpacks all the .pack files into their individual asset, the game has 81k FSB files, i guess most of them are samples.

    I get the error i mentioned when opening any of the decently sized files, the really small ones(1k -10k in filesize for example) just lock up the application and it sits there grinding my HD and the memory use going up and up

    VLC just gives noise/static when playing back an extracted .wav. I already tried this last time but forgot to mention it as i tried so many programs to play it back i forgot which one it was ;p

    Example files, all give the same error:

    2.2Mb: http://www.zenadsl5706.zen.co.uk/PS2/MX_MAIN_THEME_nc.fsb

    150Kb: http://www.zenadsl5706.zen.co.uk/PS2/VEH_S...EXT_IDLE_LP.fsb

    2.5Kb: http://www.zenadsl5706.zen.co.uk/PS2/DX_SO...CK_01_es_ES.fsb

    image
    image

    Hopefully this post will be of some use to you.

    CODE
    ##file is in big endian
    ##
    ##a pack file has several parts which are all identical in structure.
    ##there is no global header. not even magic
    ##
    ##
    ##START OF ONE PACK FILE PART
    ##
    ##metadata section (0x2000 bytes):
    ## uint32: absolute offset for the next part of the pack file (end of current part)
    ## if last pack part: 00000000
    ## uint32: number of entries
    ##
    ## strings prefixed with uint32 length, no trailing zero!
    ## 3 uint32 after the string
    ## 1 absolute offset (this can be in another pack part)
    ## 2 length
    ## 3 crc32 of the payload
    ##
    ## padding so the section has 0x2000 bytes
    ##
    ##
    ##payload section (trivial)

    from struct import unpack,pack
    import sys
    import os

    def ps2int(num):
    intstr=str(num)
    if len(intstr)==1: return "00"+intstr
    elif len(intstr)==2: return"0"+intstr
    else: return intstr

    class entry:
    pass

    root=sys.path[0]+"\\"
    inputfolder=root
    targetfolder=root+"assets"+"\\"

    ij=0
    while 1:
    partSize=1 #anything non-zero to make a do-while
    entrylist=[]
    fname=inputfolder+"Assets_"+ps2int(ij)+".pack"
    if not os.path.exists(fname): break
    f=open(fname,"rb")
    print fname
    while partSize:
    partSize=unpack(">I",f.read(4))[0]
    numEntries=unpack(">I",f.read(4))[0]
    for i in xrange(numEntries):
    ent=entry()
    stringlen=unpack(">I",f.read(4))[0]
    ent.name=f.read(stringlen)
    ent.offset,ent.size,ent.crc32=unpack(">III",f.read(12))
    entrylist.append(ent)

    end=entrylist[-1].offset+entrylist[-1].size
    f.seek(partSize)

    for ent in entrylist:
    extension = os.path.splitext(ent.name)[1][1:]
    f.seek(ent.offset)
    targetfolder2=targetfolder+extension+"\\"
    if not os.path.isdir(targetfolder2): os.makedirs(targetfolder2)
    f2=open(targetfolder2+ent.name,"wb")
    f2.write(f.read(ent.size))
    f2.close()

    f.close()
    ij+=1
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    edited January 2013
    Thanks for getting back to me on this.

    81k FSB files, whoa, that is a lot. Wonder why they aren't packed together?

    After checking out those FSB files you linked to, I did find two minor bugs, but nothing that would lock up the program and cause the HD and memory usage to freak out. One of the errors would happen when you dragged and dropped a file to open it, the other was just a small display error with the "unknown extra id number".

    The noise/static you get is as I mentioned before, they're ADPCM files, and they are compressed in a special way, different to regular ADPCM files, that I have no idea how to play back properly. VLC can play some of them, Natural Selection 2 for example, but not all.

    I'll update here if I figure out more.
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members Posts: 4
    I actually forgot to upload one of the problematic files that freaks out your tool, maybe it's not a sound file at all but something else?
    http://www.zenadsl5706.zen.co.uk/PS2/freak..._HISS_LP_01.fsb

    ADPCM was used on the GameCube and had it's own compression type so i check that and it's not one of those, but i know people(over at encode.ru) who if anyone is going to know it'll be them or one of their colleagues in the world of compression, although they aren't specifically working on sound stuff but may have an idea if it's a known algorithm and not some private FMOD one.
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    edited January 2013
    After looking into things more, I realised I missed an important part of the FSB5 format. Some of the samples for PlanetSide 2 are stored as Ogg Vorbis. They are without any headers though, so I don't know how to play them, perhaps I can find a way to attach a dummy header to this data? Will have to read into the Ogg container format.

    Some samples are however in ADPCM, and just like some of the ADPCM samples in NS2, they won't play properly even when using the in_xbadpcm Winamp plugin from here. ADPCM from what I understand is encoded using a common conversion table, and perhaps FMOD is just using their own specific tailored one for the FSB files.

    The new release will show the PS2 samples as being Ogg Vorbis. Just make sure to disable the "Add Wave Header" option, as I didn't turn that specifically off for the Vorbis format. Or perhaps some players will work with the data better in a RIFF WAVE container?
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • AeonAeon Join Date: 2013-01-13 Member: 179412Members Posts: 2
    Hi Aezay. I was using your Extractor a few months back, but my backup program didn't save the actual extractor. Your personal site's unavailable, so I was wondering if you had another upload of it? Thanks for all your hard work!
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    edited January 2013
    QUOTE (Aeon @ Jan 13 2013, 10:05 PM) »
    Your personal site's unavailable

    Are you finding both http://aezay.dk as well as http://aezay.site11.com unavailable?
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • AeonAeon Join Date: 2013-01-13 Member: 179412Members Posts: 2
    edited January 2013
    QUOTE (Aezay @ Jan 13 2013, 05:40 PM) »
    Are you finding both http://aezay.dk as well as http://aezay.site11.com unavailable?

    Aezay.dk immediately redirects to aezay.site11.com for me, so yes.

    I noticed site11 is a subdomain for 000webhost. Don't they have a sort of routine maintenance or something that results in sites being unavailable for a bit? Could that be it?

    Edit: I was able to access the site and download to my dropbox from my phone, but for whatever reason my PC can't connect to the site. Weird.
    Post edited by Unknown User on
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members Posts: 4
    Been having a look around quickly at this and tried just appending an Ogg header to the file but of course it wasn't that simple :) Each chunk needs an OggS header with various bits set after looking at the dev docs. Then i googled and found this: http://forum.xentax.com/viewtopic.php?f=17&t=9874
    Seems while it is Ogg, PS2 uses some newer FMod stuff that does funny things to it so it may take a while for someone to figure it out.
  • KeinKein Join Date: 2013-01-23 Member: 181402Members Posts: 1
    edited January 2013
    Aezay, you still here and visiting this thread? I was curious if you could add support for Vessel's new version of FSB containers. It does detect files but cannot extract properly (just some random mess in the end). A pity, because due to some legal issues the actual OST will never be available (accroding to studio head) and thus extracting tracks from game resources is the only way to get it in decent quality.

    UPD: nvm, extractor works fine, it is ww2ogg that cannot parse it. Damn.
  • ChopsChops UW Technical Artist (and Store Guy) Join Date: 2009-08-06 Member: 68373Super Administrators, NS2 Developer, Pistachionauts Posts: 51 admin
    I believe this project file is in the assets folder included with game download now. I'll poke Simon again about getting a tutorial going for this.
    Brian Cummings
    Technical Artist
    Unknown Worlds Entertainment
  • PaajtorPaajtor Join Date: 2012-11-09 Member: 168634Members Posts: 308 Advanced user
    Chops wrote: »
    I believe this project file is in the assets folder included with game download now. I'll poke Simon again about getting a tutorial going for this.
    Is it called NS2.fdp?
    Can't find anything else that looks like it.
  • VancaVanca Join Date: 2004-03-03 Member: 27090Members, Constellation, Reinforced - Shadow Posts: 5 Fully active user
    edited February 2013
    I'd like to extract the chuckle sound to use as a text ringtone. I've tried the tool in the ns2 folders and several other things to no avail. Turned to this as the last attempt but the site in OP is unavailable. Anyone still got the latest version of the extractor?

    Edit: managed to get on the site earlier and got it. Can't find the chuckle though
    Post edited by Vanca on
  • eshazeareshazear Join Date: 2013-03-05 Member: 183719Members Posts: 1
    edited March 2013
    Hello,

    I'm trying to extract the music for a PC game : Might & Magic Clash of Heroes.
    The res folder contains these two files (MMCoH_Music_Bank.fsb, MMCoH_Music.fev) amongst others.
    When trying to load the fsb with Aezay's extractor, the response is that the file is invalid.

    Looking at the .fev file content reveals that several dozen audio files are referenced...

    Is there another way to determine which fsb format (or variation thereof) has been used for this game?
    Thanks.
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members Posts: 188 Fully active user
    Vanca
    It's probably one of the "alien_2.fsb\taunt" or "alien_3.fsb\taunt*" samples, which all happens to be of the unplayable ADPCM format sadly.

    eshazear
    It's possible that those FSB files are encrypted, if you take a look at them in a hex editor, the 3 first characters of an FSB file should be FSB, otherwise it's encrypted or not an FSB file at all. The fourth character is the major FSB version, usually "3", "4" or "5".
    Ahm, could you please pass me the last piece of that delicious nubcaek?
  • jimmyb254jimmyb254 Join Date: 2013-08-31 Member: 187369Members Posts: 1
    Hi Aezay,

    Thank you so much for your FSB extract tool. I would like you know that it works wonderfully on Star Trek Online's .fsbs.

    I have a feature request, however: is there any way to add all fsb's from a folder for mass convert using your tool, command or gui? I could find no such feature, even in the readme- although you gave instructions on how to run it in console mode, I would rather not manually list all of the files as stated- could you add this feature or is there something that I missed?

    Jimmy
  • CobaraCobara Join Date: 2013-09-21 Member: 188394Members Posts: 2
    Hey

    What stuff u guys recomend to repack fsb data?
    I have fsb files in version 4
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts Posts: 2,153 mod
    If you are trying to make a sound mod, that isn't how you do it, you need to download FMOD designer and then make it in a .fev. You can search for a few tutorials on the forums. But I don't know of any FSB packers, other than the free FMOD designer which might do that.
    My mods --- Watermod collaboration with Feha
    For some reason, the instant you ask players to behave differently to be successful, they associate that with bad mapping. - KungFuDiscoMonkey
    Z5UIr2s.png
«1
Sign In or Register to comment.