READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

XMA transform

Get help on any and all audio formats, or chip in and help others!
Post Reply
AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

XMA transform

Post by AlphaTwentyThree » Fri Jun 01, 2012 5:29 pm

Hello fellow revvies, coders, game modders, VGM lovers and gamers!

Several years have passed now and till now I found that the majority of the XMA formats and variations can be decoded with toWAV after a proper manipulation. My goal is to develop a script that has the ability to transform all kinds of XMA variations to files that are decodable by toWAV.
For the script in the attachment to work you'll need xma_parse (http://hcs64.com/vgm_ripping.html) in the same path than the script or in any path that is added to the PATH variable in Windows.
Please read the instructions inside the script, you WILL need to adjust variables!

If you encounter any XMA file that doesn't work with this script, please post here!
I'll update the script from time to time when I encounter new variants.

Good luck!
And Remember: a little thanks doesn't hurt. :)


Major Update 2013-09-10

Ubisoft multilayer XMA script awaiting approval: viewtopic.php?f=17&t=9023&p=88021#p88021
You do not have the required permissions to view the files attached to this post.
Last edited by AlphaTwentyThree on Thu Jan 28, 2016 6:26 pm, edited 59 times in total.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

hcs
mega-veteran
mega-veteran
Posts: 263
Joined: Sun Oct 18, 2009 9:41 pm
Location: Portland, OR
Has thanked: 3 times
Been thanked: 72 times
Contact:

Re: All things XMA

Post by hcs » Sat Jun 02, 2012 7:36 am

fwiw, my xmash program (bottom of http://hcs64.com/vgm_ripping.html ) will handle most of these steps for some of the most common XMA types (FSB, RIFF wav, .bnk). Might be a good first thing to try, it'll save you everything but running the output through towav.

Good to have some clear directions for when that doesn't work, though.

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Tue Jun 12, 2012 2:43 pm

Checked out your xmamash program and very soon found xma files that didn't transform properly.
I've written a QuickBMS script that calls xma_parse externally and which supports all XMA variants I've encountered so far. =)
No pun intended though, I don't want to undermine your program!
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: All things XMA

Post by OrangeC » Tue Jun 12, 2012 11:45 pm

Thanks!!

So this works only if the xma has a RIFF header or can it work on non-Header'ed XMA's?

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Wed Jun 13, 2012 9:35 am

I've added one little variation where thee's an "xma." before the RIFF/RIFX but of course there are other variations.
Still need to add multichannel and XMA1 support though. Just PM me files that aren't processable right away. :)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Mon Jun 18, 2012 3:15 pm

MAJOR UPDATE:
Now supports *.SoundNodeWave files from the Unreal 3 engine! :)
Still have to work out a correct marker transformation though. If anyone is firm with wave markers, just post here and you could help. :)

EDIT: just made another quick update to prevent the saving of the SoundNodeWave header when there are no markers present. I don't want to confuse anyone. ;)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Sun Jun 24, 2012 5:26 pm

MAJOR UPDATES:
- corrected function call to COMTYPE and clog (thanks Luigi ;) )
- simplified runs with different block sizes
- added option to retrieve the file name from the cue section (e.g. The Amazing Spider-Man, Star Wars: The Force Unleashed II)
- added multichannel support !!! :)

This scripts is getting bigger and bigger and there are already two XMA types here I want to add support for!

Don't forget to click that little you-know-which button on the first post. ;)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Tue Jun 26, 2012 6:23 pm

Update

I just made the script a little bit better to use with the introduction of the BLOCKSIZE variable:
For the first run, only select one file and set the blocksize variable to "" (empty). The script will try to parse the file with the most common block sizes (stated in the file name).
Set BLOCKSIZE to the correct blocksize (hex notation). The biggest file usually has the right blocksize. Note: If the blocksize is 0x10000, the files parsed with 0x10000, 0x20000 and 0x40000 are the all same size. Now you can select all files you want to process. The script will now leave out the blocksize. :)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Thu Jun 28, 2012 3:43 pm

UPDATE

Something with the heuristics was wrong, so I skipped some automated blocksize identification. This will be implemented later on anyway.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Fri Jun 29, 2012 2:05 am

UPDATE

XMA variant with hex "00000000 00000200" file start and stream start at 0x800 supported. Encountered in "Are You Smarter Than A 5th Grader: Make the Mark" (XBLA) as *.wav files but there may by other games that use this variant.
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Sat Jun 30, 2012 7:26 pm

Update

Added another *.SoundNodeWave variant I just encountered in Alien Breed: Evolution (XBLA). :)

Help me to update this script by sending me XMA files that won't transform properly!
And don't forget to leave a thanks. ;)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: All things XMA

Post by OrangeC » Sat Jun 30, 2012 8:12 pm

Hey alpha that max payne 3 xma file i sent you is it possible if that can be transformed with the script?

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Tue Jul 03, 2012 3:57 am

OrangeC wrote:Hey alpha that max payne 3 xma file i sent you is it possible if that can be transformed with the script?
Uh no. I didn't save the sample, can you send me one again? ;)
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

AlphaTwentyThree
double-veteran
double-veteran
Posts: 984
Joined: Mon Aug 24, 2009 10:55 pm
Has thanked: 75 times
Been thanked: 622 times

Re: All things XMA

Post by AlphaTwentyThree » Tue Jul 03, 2012 3:59 am

Update

Just a small update: I added the option to change between XMA2 and XMA1 as source file. That only for now until I've coded some automatic blocksize/XMA version checker.
P.S.: XMA1 files just encountered inside the XWB archive of Bankshot Billiards 2 (XBLA).
If you like what you see, why not click the little Thank You button? ;) It will definitely motivate me! :)
And here's Mr.Mouse's Facebook link: http://www.facebook.com/permalink.php?s ... 8469022795 - thanks ;)

OrangeC
double-veteran
double-veteran
Posts: 860
Joined: Sun Apr 20, 2008 2:58 am
Has thanked: 5 times
Been thanked: 33 times

Re: All things XMA

Post by OrangeC » Tue Jul 03, 2012 2:18 pm

AlphaTwentyThree wrote:
OrangeC wrote:Hey alpha that max payne 3 xma file i sent you is it possible if that can be transformed with the script?
Uh no. I didn't save the sample, can you send me one again? ;)

Hehe i will have to download the game again and get the sample as the sendspace link died. :)

Post Reply