Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: SoundExtractor v1.2

  1. #1
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default SoundExtractor v1.2

    [19 July 2012] v1.2 - fixed: v1.1 (might?) fail to run correctly on Vista/Windows7

    This extracts sound dat/idx files in a simple-to-use fashion. It includes and uses the XIDX tool for the extracting operation. All I have done is added a BAT file to simplify its operation and have the sounds extracted to folders directly under the "sounds" folder.

    The intention is that submods that add/change sounds no longer need to package up and distribute the dat/idx files. Instead, they only need to distribute the actual wav/mp3 files and have the users run this BAT file. This avoids sound incompatibility problems between submods (where two submods both include dat/idx files) and reduces the size of the submod download.

    Instructions
    These instructions use the Third Age mod as an example only:
    • TATW mod folder = something like C:\Programs\SEGA\Medieval II Total War\mods\Third_Age

    Use the appropriate folder for the mod you are running this for. Or the root installation folder if you are running this for vanilla (e.g. C:\Programs\SEGA\Medieval II Total War).

    NOTE: you will need a fair amount of free hard drive space! Go to the mod's sounds folder (e.g. C:\Programs\SEGA\Medieval II Total War\mods\Third_Age\data\sounds) and get the sum total of all of the *.dat and *.idx files (select them all, right click > Properties). You will need about twice that amount of free space. e.g. If the total is 400MB then you will need 800MB of free space: probably a bit more.

    Instructions:
    1. Download the attachment and extract it to the mod folder:
      • NOTE: Extract it such that it extracts directly into the folder (e.g. "Extract Here") rather than into a new subfolder (e.g. "Extract to SoundExtractor...")
      • There should now be a SoundExtractor folder under the mod folder. e.g. C:\Programs\SEGA\Medieval II Total War\mods\Third_Age\SoundExtractor
      • i.e. SoundExtractor.bat should be located here: {mod folder}\SoundExtractor\SoundExtractor.bat, not here: {mod folder}\SoundExtractor\SoundExtractor\SoundExtractor.bat
    2. Run (double-click) SoundExtractor.bat
      • NOTE: For Vista/Windows7/later users you might need to run it as an administrator: right click > Run as administrator
    3. A command window opens and shows you the progress: it will tell you when it has finished
    4. Now you may install the files for the submod that this SoundExtractor is being used for. Do not start the game until the submod is installed.

    After it has finished you should see this in the sounds folder:
    • Music, SFX and Voice subfolders
    • A "backup" subfolder with today's date: inside that are dat/idx files
    • No dat/idx files in this sounds folder


    Once you have finished installing the submod (not this SoundExtractor: the submod that this SoundExtractor is being used for) start the campaign. This will rebuild the dat/idx files in the sounds folder - this is what the game uses. The other folders are now no longer needed so you may delete them (freeing up a lot of hard drive space). i.e. You may delete the Music, SFX and Voice subfolders and the "backup" subfolder. NOTE: if you are merging multiple submods then read below before deleting anything: you might still need them.


    The rest of this post is aimed at submod authors who wish to use this and anybody who is merging more than one submod where one (or more) is using this method.

    Background
    The game reads sound files from the dat/idx files under the sounds folder. If any of these dat/idx files do not exist then the game - during startup - rebuilds them from the contents of the Music, SFX and Voice subfolders and the contents of the sound text files. (NOTE: if the mod is for Kingdoms and it does not already have the missing sound files then you will need them.)

    Therefore, to add a new sound three steps are needed:
    1. Extract the dat/idx files into the Music, SFX and Voice subfolders of the sound folder
    2. Add your sound to the appropriate place in these subfolders (and into the appropriate sound text file)
    3. Delete the dat/idx files, forcing the game to rebuild them from the subfolders


    Normally, as a submod author who is trying to add a sound, you would do this dat/idx rebuilding yourself and include the dat/idx files in your submod, overwriting the ones already in the mod when the submod is installed. The problem with this is:
    1. If another submod is doing the same thing (including dat/idx files) then they are incompatible: one submod will overwrite the other's dat/idx files. It would be up to the user who is trying to use both of them to unpack, merge and rebuild the sound files; no small task, especially for someone who doesn't already know how to do this kind of thing.
    2. Your submod's size could now be hundreds of megabytes because it contains large dat file(s), even though your only addition might be one sound file of a few kilobytes.


    SoundExtractor
    By using SoundExtractor instead you would:
    • Include just the new sound file in your submod's distribution (instead of the dat/idx files), in the appropriate sounds subfolder location.
    • Instruct the user what to do:
      • Download SoundExtractor and run SoundExtractor.bat. [The sound subfolders now exist on the user's PC.]
      • Install your submod. [Your new sound file now exists in the user's sounds subfolder tree.]
    • The dat/idx files are rebuilt when the user next starts the game.


    To make the user's life even easier you could bundle SoundExtractor in with your submod's distribution. That way the user doesn't need to download it separately and unzip it. BUT: only if you are adding sounds. If you are replacing a sound that already exists then it won't work because when the user installs your submod it will put that sound file under the relevant sounds subfolder, then when the user runs the BAT file the extracting process will overwrite your file with the one from the dat file. i.e. For replacing sounds the extracting needs to be done before your sound files are moved into the sounds subfolders.


    Merging Multiple Submods
    To combine sounds from more than one submod the goal is this: get all of the sounds into the sounds subfolders and only then start the game to combine them all into the rebuilt dat/idx files.

    If you install one submod and start the game then the dat/idx files are now rebuilt; any files added to the sounds subfolders after that (from another submod) will be ignored because the game can see - and will use - just those dat/idx files. However, easily fixed: just delete the dat/idx files. They will now be rebuilt including the other sound files you added.

    If a submod includes sound dat/idx files then make sure that these files are in the sounds folder before running SoundExtractor.bat.

    If two submods include sound dat/idx files then do the submods one at a time:
    1. Put the files from submod 1 in the sounds folder and run SoundExtractor.bat
    2. Put the files from submod 2 in the sounds folder and run SoundExtractor.bat


    Credits
    The Europa Barbarorum Team for the XIDX tool which is based on the work of Vercingetorix. Thank you Tellos Athenaios for the permission.

    Terms Of Use
    XIDX and this SoundExtractor BAT file are licensed under GPL. Meaning, essentially: it is free and there is no warranty whatsoever. Use at your own risk. See licence.txt for a copy of the full licence.

    Compatibility
    This should also work for RTW. XIDX certainly does but I have not tested this SoundExtractor on RTW.

    Change Log
    • v1.1
      • The BAT file's "wrong location" message mentioned Third_Age_3. Now made generic.


    DOWNLOAD: SoundExtractor_1.2.zip
    Last edited by Withwnar; June 20, 2016 at 10:07 PM. Reason: fixed XIDX link

  2. #2

    Default Re: SoundExtractor

    You've forgot give credits to original creator of xidx.
    Originally developed by Vercingetorix

  3. #3
    Ngugi's Avatar TATW & Albion Local Mod
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    10,687

    Default Re: SoundExtractor

    As always your work is a great contribution to this community and all who attempts battle the forces of mod obsticles +rep

    Kingdom of Lindon preview video out





    DCI: Last Alliance
    - WIP Second Age mod | DCI: Tôl Acharn - mighty Dúnedain Counter Invasions |
    Additional Mercenary Minimod - more mercs; for TATW and DCI | Family Tree minimods - lore improvements | Remade Event Pictures - enhance cultures trough images |
    Favorite TATW compilation: Withwnars Submod Collection
    Patron of Mank, Kiliç Alì, FireFreak111, MIKEGOLF & Arachir Galudirithon, Earl of Memory

  4. #4
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: SoundExtractor

    Quote Originally Posted by Galloper View Post
    You've forgot give credits to original creator of xidx.
    sic!
    Besides that, nice.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  5. #5
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor

    Thanks guys.

    The credits have been updated.

    EDIT: update: I just realised that the BAT file mentions Third_Age_3 as the correct location when showing a wrong location message. Fixed in the new v1.1.
    Last edited by Withwnar; May 31, 2012 at 11:41 PM.

  6. #6
    Moneybags14's Avatar Ordinarius
    Join Date
    May 2010
    Location
    United States
    Posts
    709

    Default Re: SoundExtractor v1.2

    This dude. Is a ing beast! Tools out the wazzoo mang, I should just hire you. I wish I could program but alas, my scripting knowledge ends with MTW2 .

    Thanks for the tool, having dwarfs with orc sounds was not meshing well. I can't rep you yet!

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor v1.2

    Quote Originally Posted by Moneybags14 View Post
    Tools out the wazzoo mang
    What? Glad it helped.

  8. #8

    Default Re: SoundExtractor v1.2

    Quote Originally Posted by Withwnar View Post
    Now you may install the files for the submod that this SoundExtractor is being used for. Do not start the game until the submod is installed.[/contentbox][/fieldset]
    Great tutorial, but could you clarify me this part? ^ The command window said it had finished. I went to data/sounds and there where 5 files: voice, SFX, music, effect_evt and backup. Inside of them there are the mp3 files. Is there anything I have to do before I start the game? What files do I have to install?

    Thank you very much, and sorry for my lack of hability

  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor v1.2

    There are three cases where you would need to use this tool:

    1) A submod is adding sounds and told you to use this. These tool instructions are saying use this tool to extract, then install the submod's files*, then start the game.
    2) You're adding/changing sounds of your own, not from a submod. In that case drop your sounds files into the relevant folders that this extractor has created, before starting the game.
    3) You just wanted to extract the sounds so you could get to the MP3/WAV files to hear them or whatever. There's nothing else to do in this case.

    * The submod will add/change sound files in the extracted folders.

  10. #10
    Zarathos's Avatar Miles
    Join Date
    Dec 2006
    Location
    Verona, Italia
    Posts
    325

    Default Re: SoundExtractor v1.2

    Is it also possible to remove existing sounds from a IDX/DAT?

  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor v1.2

    Only by: extract all, delete what you want from the folders, repack all.

  12. #12

    Default Re: SoundExtractor v1.2

    I assume this tries to read the registry to get M2 installation folder...is there any workaround to this?
    I dont want to install M2 again just to recreate the registry info, (i dont have m2 registry info because i installed it in an external drive with another machine than the one im currently using)

    Oh NVM just had my folder structure not properly set

    It works all good

  13. #13
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor v1.2

    Good. And no, for the record, it doesn't read the registry.

  14. #14
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SoundExtractor v1.2

    From a PM...

    Quote Originally Posted by noobmoder15
    Hello I was wondering if you know how to solve this problem that I'm having with your sound extractor. Now first of all let me say this, your program works with mods but every time I use it to extract sounds for vanilla M2TW it extracts the sounds but not voices 1, 2, or 3 for some reason it doesn't extract or even show them other than just a folder called "voice" in my sounds folder yet I do have my UAC disabled, I have my SEGA folder with full permission to mod and what not, my antivirus disabled while extracting, run as administrator, game is installed under C:\Games\SEGA..., even unmarking them from READ ME in properties yet still no extraction I even used that IDX extractor from Vercingetorix yet every time the extractor gets to Voice 3 it crashes and skips the file. I'm right now thinking that I might need to redownload the game from Amazon maybe that could be the problem.

    If you must know what business I have with extracting vanilla it's due to the fact that earlier I've fixed an issue involving missing sound effect for oil in my private Retrofit mod but unfortunately I have missing voices for certain faction on the campaign map with almost everybody having no voices while selected.

    Any help would be appreciated. Thank you for your time.
    I don't know what the bold bit means but anyway...

    As this tool just uses XIDX I would try using that directly and if it doesn't work then ask for help in its thread. There's a link to it in the OP of this thread.

    I had no problem using SoundExtractor on the vanilla files (Kingdoms v1.5) but that was only tested on a 32bit XP machine.
    Last edited by Withwnar; June 20, 2016 at 10:10 PM.

  15. #15

    Default Re: SoundExtractor v1.2

    TX! for extrcator

  16. #16
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: SoundExtractor v1.2

    nevermind
    Last edited by leo.civil.uefs; November 13, 2019 at 09:17 AM.

  17. #17

    Default Re: SoundExtractor v1.2

    Hi! Can you update the download link?

  18. #18

    Default Re: SoundExtractor v1.2

    Quote Originally Posted by dogfish View Post
    Hi! Can you update the download link?
    Not the OP, but here is my copy from years ago, though I don't know if it's all nice clean.
    https://drive.google.com/file/d/1eDH...ew?usp=sharing

  19. #19

    Default Re: SoundExtractor v1.2

    So a year latter, I though it best to upload this to Github rather than a random google drive lol. Here is a link for back up. https://github.com/EliteNinjaX/SoundExtractor-v1.2

  20. #20

    Default Re: SoundExtractor v1.2

    Do you know why when I extracted sounds there are only "music" and "sfx" files?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •