@Moonboy65 - If you don't want to help, then don't go out on random threads saying "nice thread title lol", because you just look like you are trolling someone out of spite.
DOing that and typing in the text gets me "unable to access jarfile AudioTool-decode.jar
EDIT!!!!
having gotten prompt to run out of the folder I have those programs in, it reads that it could not recreate the Java Virtual Machine and unrecognized option
Good to know that my research on this format was useful. That was really exciting to crack an unknown format without the code or any possibility to know the tables used. HCS must know what I mean ;)
Indeed it's very cool, I'd love to hear how you were able to do it.
I worked out most of MTAF without access to the code and I was able to approximate the table by minimizing the errors in the history samples; this involved a linear algebra solver with lapack and blas (here).
But eventually someone just sent me code containing the exact table, which retrospectively is pretty obvious in a memory dump. Are your tables exact, or a very good approximation?
Yeah, it was a cool story. Many rounds of precision increase (iterations), and finally I calculated the exact values.
First I found the interleave scheme. Initial samples, nibbles. I thought it was IMA like in MTAF, but it was not. After more analizing the nibbles, I understood it was XAS variant, but with bigger tables. Instead of just 4 predictor types and 13 shifts (from 0 to 12 bits), like in EA XAS, in has 8 types and 32 scale coefficients.
I had no idea of the table values. So first I tried decoding each block and see if it will correspond with the initial sample value of next block. I took very quiet first blocks, which had 0 shift/scale. Predictor 2 was most used, so I tried it first, then others. This way I found that actually first 5 types (predictors) were usual XAS types. 240/0, 460/-208, you know that. Other 3 predictors were probably invented specially for MTA2.
Then I had to do something with scale table. I made a very rough approximation of all 32 values, and that allowed me to decode the whole music track. It was heavily distorted, as you can imagine. I still have that sound saved for history :)
Then one by one I started to correct the table values. After many iterations I was able to increase precision of predictors and scale table in turns. It was slow, so I made a solver, just as you did. It allowed me to find exact predictors values. The deltas were so clear, that I have no doubt, they are correct.
The final step was to find exact values for scale table. Music track couldn't help me with that, because highest values were rarely used, and lowest values introduced too much of a range. So I had very good approximation in the middle of a table, and not-so-good at the ends.
Then, after making a visual graph from these values, I suddenly understood they were calculated by some simple and logical formula. After some time, I was able to guess that formula, and the result was a perfectly clear sound.
well i could release my tool used for experiments as a normal .exe, but there are so many types of containers... movies, voices, sfx, they all use the same codec.
"demux_dat 0.2 extracts audio from the .DAT files in Metal Gear Solid 3. Included is demux_dat_be which should work on Metal Gear Solid 4, but it is not tested."
Well, with that said, it extracts .dat files that contain only audio, video and subtitle data. That means it's unstable of extracting .dat files that contain other types, right? Here's codec.dat for example.
Negative, you can also extract MTA2 from dbm files. DBM files works in different way, so rename the file is not the solution. Extracting the mta2 within it's so simple, remove first 2080 bytes and then try to convert the "dbm" file.
Well I tried what you suggested and it worked fine except for these two files(I was rewarded with a "unknown block type 0 at 0" error). Here's a sample.
^ Well, no need to do that because I was actually mistaken. demux_dat_be.exe can work with these just fine, since I didn't realize I already saved those files.
That Direct Buffer error means it ran out of memory. Right not the tool doesn't work for very large files, I think there are like 2 files it won't work on.
Right now, the whole tool is undergoing a rewrite to better support the BGM/DLBM formats, and is really focusing on importing/encoding audio. Speech and SFX support will come too, I just haven't looked at it lately.
DLBMs should work out of the box, though. You shouldn't need to dechunk them. You could try the older GUI version that I made a while ago, maybe it will make it simpler for you. https://mega.nz/#!glQQ3ITC!9e7VV3cmupKbIY2_w3E9T4TlVls2wUR_KbdSJaoHjaI
The audio playback won't work unless the sample rate and channels are supported by your computer. 1/2 channel tracks usually work just fine, 4 channel I can't get playing on my computer right now. I'll be sure to mix the channels in my newer version. You can easily export them, however.
But yeah, if you need help with anything, I'll be keeping an eye on this thread. Didn't see it before.
Has anyone had any luck with using demux_dat_be.exe on MGS4's vox.dat? I get the following output from vox.dat (US retail release, BLUS30109): file 1 at 0x00000008 has audio (subtype 1) file 2 at 0x00008808 has audio (subtype 1) file 3 at 0x002d2808 has audio (subtype 1) file 4 at 0x005b1808 has unknown 3 (subtype 5) file 4 at 0x005b1818 has audio (subtype 1) file 4 at 0x005b1828 has unknown 4 (subtype 6) unknown content descriptor 00000007 at 0x005b1838
The first three files are extracted and convert using the MTA2 audio tool, then file 4 encounters the unknown content descriptor and then halts further output. Some musical cues appear to be contained within, files 2 and 3 are the chapter start stingers. (Although, I'm mainly interested in the dialogue.)
On DBM files for people confused. Talking about the MGS4 audio JAR tool, I got it to work by changing the bat.bat and replacing ".mta2" with ".dbm" I'll copy paste the code here, if you're missing the bat with the .jar
for %%f in (*.mta2) do java -jar AudioTool-decode.jar "%%f"
for %%f in (*.dbm) do java -jar AudioTool-decode.jar "%%f"