Code/library for decoding Microsoft Xbox 360 XMA audio?

Get help on any and all audio formats, or chip in and help others!
Post Reply
jfwfreo
veteran
Posts: 116
Joined: Sat Nov 15, 2008 1:31 am
Been thanked: 21 times

Code/library for decoding Microsoft Xbox 360 XMA audio?

Post by jfwfreo » Sat Aug 20, 2016 2:07 pm

Is there code or a library out there that can decode audio compressed with the Microsoft Xbox 360 XMA codec?
Not interested in tools that can decode it, I need code or a library I can use (as the XMA audio I am working with is inside another larger file and I want to be able to feed XMA audio in and get uncompressed samples out).
Also not interested in anything that is copied from Microsoft SDKs or leaked or otherwise not legally usable since this is going to be part of a tool I will be shipping.

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

Re: Code/library for decoding Microsoft Xbox 360 XMA audio?

Post by hcs » Sat Aug 20, 2016 6:53 pm

ffmpeg's libavcodec has WMA Pro support that does XMA and XMA2 (RIFF codec 0x165 and 0x166):
https://github.com/FFmpeg/FFmpeg/blob/5 ... dec.c#L294

XMA is essentially just WMA Pro with decode_flags = 0x10d6, though the blocking is different (especially with XMA2).

You may need to use my xma_parse tool to massage the data into a format that this can deal with, and add a RIFF header (or use xmash, if your particular container is supported). xmash and xma_parse are here: https://hcs64.com/vgm_ripping.html

[edit]
AlphaTwentyThree's XMA transform ( viewtopic.php?f=17&t=9023 ) has support for extracting from a whole lot of different containers for XMA, using xma_parse on the backend.

Post Reply