[Tool] FSB Extractor

AezayAezay Join Date: 2003-04-19 Member: 15660Members
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.



[color=#98fb98][b]Description[/b][/color]

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.



[color=#98fb98][b]FSB Extractor - FMOD Sample Bank Extraction Tool[/b][/color]

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.



[color=#98fb98][b]Official Site[/b][/color]

[url=http://aezay.dk/aezay/fsbextractor/]http://aezay.dk/aezay/fsbextractor/[/url]



[color=#98fb98][b]Direct Download[/b][/color]

[url=http://aezay.dk/aezay/fsbextractor/FsbExtractor13.03.09.rar]FsbExtractor13.03.09.rar[/url] - Support for FSB files with basic headers.[color=#ff8080]

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
[/color]
«1

Comments

  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    nice, this would probably work for most games that use fmod very useful.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    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
    <!--quoteo(post=1946596:date=Jun 26 2012, 03:03 AM:name=simon kamakazi)--><div class='quotetop'>QUOTE (simon kamakazi @ Jun 26 2012, 03:03 AM) <a href="index.php?act=findpost&pid=1946596"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->nice, this would probably work for most games that use fmod very useful.<!--QuoteEnd--></div><!--QuoteEEnd-->
    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.
  • simon kamakazisimon kamakazi Join Date: 2009-04-28 Member: 67296Members
    <!--quoteo(post=1946660:date=Jun 26 2012, 10:50 AM:name=Yuuki)--><div class='quotetop'>QUOTE (Yuuki @ Jun 26 2012, 10:50 AM) <a href="index.php?act=findpost&pid=1946660"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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 ?<!--QuoteEnd--></div><!--QuoteEEnd-->


    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
    <!--quoteo(post=1948334:date=Jul 2 2012, 07:02 AM:name=simon kamakazi)--><div class='quotetop'>QUOTE (simon kamakazi @ Jul 2 2012, 07:02 AM) <a href="index.php?act=findpost&pid=1948334"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->ill also do a nice tutorial on how to get your own sounds into the game.

    cheers

    simon<!--QuoteEnd--></div><!--QuoteEEnd-->
    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
    Anyone got a link to this that works??
  • beaglebeagle Join Date: 2010-12-04 Member: 75469Members, Reinforced - Shadow
    <a href="http://aezay.site11.com/aezay/fsbextractor/" target="_blank">http://aezay.site11.com/aezay/fsbextractor/</a>

    There if anyone else is looking.
  • uraganuragan Join Date: 2012-05-28 Member: 152677Members
    edited July 2012
    hi
    i cant download your tool,
    is it outdated?
    or, your website is offline?

    EDIT: Tool is online thx
  • snailerisnaileri Join Date: 2012-11-01 Member: 165480Members
    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
    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
    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
    <b>Intrinsic</b>
    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.
  • CarNagE1CarNagE1 Poland Join Date: 2003-05-14 Member: 16298Members, NS2 Playtester, Reinforced - Shadow, WC 2013 - Supporter, Subnautica Playtester
    I was just looking for a tool like this :) great!
    Thx
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members
    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: <a href="http://www.zenadsl5706.zen.co.uk/PS2/MX_MAIN_THEME_nc.fsb" target="_blank">http://www.zenadsl5706.zen.co.uk/PS2/MX_MAIN_THEME_nc.fsb</a>

    150Kb: <a href="http://www.zenadsl5706.zen.co.uk/PS2/VEH_SCYTHE_ENG_EXT_IDLE_LP.fsb" target="_blank">http://www.zenadsl5706.zen.co.uk/PS2/VEH_S...EXT_IDLE_LP.fsb</a>

    2.5Kb: <a href="http://www.zenadsl5706.zen.co.uk/PS2/DX_SOLDIER_VS_F02_MELEE_ATTACK_01_es_ES.fsb" target="_blank">http://www.zenadsl5706.zen.co.uk/PS2/DX_SO...CK_01_es_ES.fsb</a>

    <img src="http://www.zenadsl5706.zen.co.uk/PS2/FSBExtractWindow.png" border="0" class="linked-image" />
    <img src="http://www.zenadsl5706.zen.co.uk/PS2/FullAssetDump.png" border="0" class="linked-image" />

    Hopefully this post will be of some use to you.

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>##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</div>
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members
    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.
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members
    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?
    <a href="http://www.zenadsl5706.zen.co.uk/PS2/freaksout-AMB_AIR_HISS_LP_01.fsb" target="_blank">http://www.zenadsl5706.zen.co.uk/PS2/freak..._HISS_LP_01.fsb</a>

    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
    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 <a href="http://aluigi.altervista.org/papers.htm#xbox" target="_blank">from here</a>. 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?
  • AeonAeon Join Date: 2013-01-13 Member: 179412Members
    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
    edited January 2013
    <!--quoteo(post=2060172:date=Jan 13 2013, 10:05 PM:name=Aeon)--><div class='quotetop'>QUOTE (Aeon @ Jan 13 2013, 10:05 PM) <a href="index.php?act=findpost&pid=2060172"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Your personal site's unavailable<!--QuoteEnd--></div><!--QuoteEEnd-->
    Are you finding both <a href="http://aezay.dk" target="_blank">http://aezay.dk</a> as well as <a href="http://aezay.site11.com" target="_blank">http://aezay.site11.com</a> unavailable?
  • AeonAeon Join Date: 2013-01-13 Member: 179412Members
    edited January 2013
    <!--quoteo(post=2060232:date=Jan 13 2013, 05:40 PM:name=Aezay)--><div class='quotetop'>QUOTE (Aezay @ Jan 13 2013, 05:40 PM) <a href="index.php?act=findpost&pid=2060232"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Are you finding both <a href="http://aezay.dk" target="_blank">http://aezay.dk</a> as well as <a href="http://aezay.site11.com" target="_blank">http://aezay.site11.com</a> unavailable?<!--QuoteEnd--></div><!--QuoteEEnd-->
    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.
  • IntrinsicIntrinsic Join Date: 2013-01-05 Member: 177594Members
    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: <a href="http://forum.xentax.com/viewtopic.php?f=17&t=9874" target="_blank">http://forum.xentax.com/viewtopic.php?f=17&t=9874</a>
    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
    edited January 2013
    <b>Aezay</b>, you still here and visiting this thread? I was curious if you could add support for <a href="http://www.strangeloopgames.com" target="_blank">Vessel</a>'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.

    <b>UPD:</b> 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
    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.
  • PaajtorPaajtor Join Date: 2012-11-09 Member: 168634Members
    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
    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
  • eshazeareshazear Join Date: 2013-03-05 Member: 183719Members
    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
    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".
  • jimmyb254jimmyb254 Join Date: 2013-08-31 Member: 187369Members
    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
    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
    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.
Sign In or Register to comment.