hcs64 / ww2ogg

Convert AudioKinetic Wwise RIFF/RIFX Vorbis to standard Ogg Vorbis
BSD 3-Clause "New" or "Revised" License
330 stars 39 forks source link

Killer Instinct (2016, PC) WEM audio files #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

The header looks like this:

$ head /b/WindowsApps/Microsoft.KillerInstinct-Win10_3.0.1.0_x64__8wekyb3d8bbwe/GAMEASSETS/AUDIO/WWISE/GENERATEDSOUNDBANKS/WINDOWS/141337191.wem | xxd
00000000: 5249 4646 0084 e800 5741 5645 666d 7420  RIFF....WAVEfmt
00000010: 1800 0000 0200 0200 44ac 0000 ccc1 0000  ........D.......
00000020: 4800 0400 0600 0000 0300 0000 6375 6520  H...........cue
00000030: 1c00 0000 0100 0000 0100 0000 0000 0000  ................
00000040: 6461 7461 0000 0000 0000 0000 0000 0000  data............
00000050: 4c49 5354 2400 0000 6164 746c 6c61 626c  LIST$...adtllabl
00000060: 1700 0000 0100 0000 4b49 476f 6c64 5f4d  ........KIGold_M
00000070: 585f 5472 6169 6e69 6e67 0000 4a55 4e4b  X_Training..JUNK
00000080: 0400 0000 0000 0000 6461 7461 7883 e800  ........datax...

but ww2ogg reports

Input: /b/WindowsApps/Microsoft.KillerInstinct-Win10_3.0.1.0_x64__8wekyb3d8bbwe/GAMEASSETS/AUDIO/WWISE/GENERATEDSOUNDBANKS/WINDOWS/141337191.wem
Parse error: expected 0x42 fmt if vorb missing

Sample file is at https://mega.nz/#!us5gDKKZ!R1VwA1w88AuSK10pyIaAfHFVts1ozWXTXI8yPP7l6es

hcs64 commented 8 years ago

As far as ww2ogg is concerned, this file type is simply unsupported, as it is not Wwise Vorbis.

This is a Wwise IMA ADPCM file, which is pretty much my archenemy. It is basically just MS-style IMA, interleaved differently, but there is some subtlety of decoding that is nonstandard such that fixing the interleave still leaves files sounding noisy.

hcs64 commented 8 years ago

A much better solution:

spider91 has a tool called simply wwise_ima_adpcm which you can find on XeNTaX or on ZenHAX, it decodes and encodes this format, and it seems to work very well on this file. Definitely a lot better than my ima_rejigger results.

ghost commented 8 years ago

Sorry for raising an issue on your app when it's not a filetype you support

hcs64 commented 8 years ago

I spent the last several hours figuring out what wwise_ima_adpcm was doing differently, finally I now have a decoder that works properly: ima_rejigger5.zip. No reason to use this over wwise_ima_adpcm for RIFF, but it also works with RIFX, and there's source, though it is ugly and rushed.

The final straw was that Wwise IMA ADPCM decodes one fewer sample per block than Microsoft's IMA format.

hcs64 commented 8 years ago

Credit where due, wwise_ima_adpcm is originally by Zwagoth Klarr (zabb65), from his Bitbucket repository with this and other tools for modding Payday 2. Source and the binary with the original readme are found there.