Found obscure audio format in romfs, don't know how to open, unpack, or edit

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by RobCat030, Jul 26, 2019.

  1. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    So I was taking my first stab at making a layeredfs patch. I was hoping to make some audio mods to Marvel Ultimate Alliance 3 (seemed simple enough). For some reason the audio files in the romfs are either compressed or contained in this strange .ktsl2stbin\.ktsl2asbin format, which I have no idea how to edit into a playable format. Is this a normal thing to encounter when working with game audio? and does anyone know how to approach modifying these types of files.
     
  2. masagrator

    masagrator File digger

    Member
    8
    Oct 14, 2018
    Poland
    First question: yes
    Second: if you have some experience, you can check with Hex editor if they are compressed or not. Probably one file contains Information about data from second file.

    — Posts automatically merged - Please don't double post! —

    For example check if you can find
    Code:
    RIFF
    In files with Hex editor. If they are common, then they are not compressed and using standard WAVE format.
     
    Last edited by masagrator, Jul 26, 2019
  3. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    Thanks! I made some solid progress with extracting them! Now to recompile...
     
  4. Sonic Angel Knight

    Sonic Angel Knight GBAtemp Legend

    Member
    18
    May 27, 2016
    United States
    New York
    I usually use Foobar2000 on windows to play audio files from switch games. It can then be converted to any common format like MP3 or M4A. Not sure if it helps, but I tried. :ninja:
     
  5. OrGoN3

    OrGoN3 GBAtemp Addict

    Member
    8
    Apr 23, 2007
    United States
    So, what format are they really?
     
  6. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    That's what I ended up doing. Now I'm trying to find a way to convert common formats back to the weird one so that I can repack a new soundtrack.

    The extension is .ktss, which is really .kns, a format used by Koei Tecmo. Problem is they don't seem to have a standardized implementation across all of their games (different hex headers and other subformats), so there isn't anything at the moment for converting between this and standard formats.
     
    OrGoN3 likes this.
  7. Jokkovitch

    Jokkovitch Member

    Newcomer
    3
    May 20, 2017
    France
    Same format as in Hyrule Warriors, are you sure they are not standard at9 files ?
     
  8. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    Unfortunately they are only the same ktsl2asbin container. The hex headers inside indicate an entirely different subformat.
     
  9. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    So I made some progress. I was able to use a dsp to ktss converter to get the replacement audio into the same format as the extracted parts (ktss). Everything plays fine in Foobar2000. However, I tried to replace the contents of the original ktslstbin file with hex editor and the game couldn't read the file at all (it booted, just without audio). Maybe because the replacement audio is larger than the original, which overwrote the padding and probably into the next track? Not sure if I can offset everything else because the game might be looking for specific headers for each audio file. So I may be restricted to the original track length. Hope that all makes sense. Thoughts anyone?
     
  10. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    Got it! Here's a sample if anyone wants to try it out. I replaced the main menu theme (which sucks in my opinion) with the Avengers (2012) theme. Unfortunately I couldn't figure out loop points, so it only plays once, but that's fine for menu navigation for me. I was gonna do more but since I haven't worked out a script for easy repacking it would take a lonnggg time. Thank you everyone!

    https://drive.google.com/file/d/14ATi_ImlCrhpUWRlvSUsypewwffGl4WY/view?usp=sharing
     
    Last edited by RobCat030, Jul 26, 2019
    orangpelupa and masagrator like this.
  11. nickjeaster

    nickjeaster Newbie

    Newcomer
    1
    Aug 10, 2019
    Argentina
    May I ask you how you managed to extract the sounds from MUA 3? I've been wondering how to do that
     
  12. RobCat030
    OP

    RobCat030 Member

    Newcomer
    3
    May 29, 2018
    United States
    Oof, not sure if I can remember but it wasn't easy. Once you have the romfs extracted, you need to extract the ktsl2stbin from the SOUNDS folder (not asbin, not sure how to extract those or what they contain). Put this in a batch file and drop onto it (courtesy of somebody named "Pingu!" on XeNTaX):

    Code:
    get BASENAME basename
    for FILES = 0
        FindLoc OFFSET string "KTSS" ""
        if OFFSET == ""
            cleanexit
        endif
        goto OFFSET
        idstring "KTSS"
        get SIZE long
        set NAME string ""
        string NAME p "%s_%s.ktss" BASENAME FILES
        log NAME OFFSET SIZE
    next FILES
    Then you need a media player called foobar2000 and a plugin called vgmstream (google).

    Hope this helps. If you can't work it out I can send you extracted and converted audio files (just tell me which one). Converting new wav files to recompile the ktsl2stbin is a whole other mess lol.
     
Loading...