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

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
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.
 

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,524
Trophies
3
XP
12,575
Country
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.

--------------------- MERGED ---------------------------

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,

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
United States
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.

--------------------- MERGED ---------------------------

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.

Thanks! I made some solid progress with extracting them! Now to recompile...
 

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
United States
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:

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.

So, what format are they really?

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.
 
  • Like
Reactions: OrGoN3

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
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?
 

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
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,

RobCat030

Active Member
OP
Newcomer
Joined
May 29, 2018
Messages
32
Trophies
0
Age
26
XP
351
Country
United States
May I ask you how you managed to extract the sounds from MUA 3? I've been wondering how to do that

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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtu.be/junTFjErOFE?si=eZcOxOiwJu1Jw6Oh