Ultimate Spider-Man PC - Unknown encoding by Nicknine at 5:51 PM EDT on April 21, 2018
This game stores audio in WBK files the format of which is same as in Spider-Man 2 except there are no filenames. The tracks themselves appear to be headerless and are described in the header of WBK file. All the music is stored in STREAMS_MUSIC.WBK.
However, I can't figure out which encoding they use. What I got is that it's a variation of IMA ADPCM and all the music in this game is 36000 Hz stereo. Also, the same encoding is most likely used in other Activision games of that era.

Sample (36000 Hz stereo)

edited 5:54 PM EDT April 21, 2018
by bnnm at 8:56 PM EDT on April 21, 2018
codec = IMA
channels = 2
sample_rate = 36000
start_offset = 0x00

num_samples = data_size
loop_start_sample = 0
loop_end_sample = data_size
by Nicknine at 5:59 AM EDT on April 22, 2018
Wait, so I needed to set interleave to 0x0? How is that possible? I thought all stereo audio needs to have interleave set. With GENH, vgmstream outright rejects headers with multiple channels and no interleave set.

edited 6:05 AM EDT April 22, 2018
by bnnm at 6:08 AM EDT on April 22, 2018
Some ADPCM codecs work with and without interleave. Without it, it means internal or "subinterleave" stereo.
by Nicknine at 6:15 AM EDT on April 22, 2018
I see. I've looked at GENH parsing code and it looks like interleave needs to be set to -1 (or 0xffffffff) in GENH so that it's disabled.
Thank you for the information.

"Without it, it means internal or "subinterleave" stereo."
Could you explain more on this? I'm interested in technical details.
by bnnm at 6:42 AM EDT on April 22, 2018
Most codecs are defined as mono, as in, when decoding a chunk of the data (say 0x1000) it only contains one channel. For those we set interleave=0x1000 so it alternates channels.

Some codecs though (ex. IMA/XBOX_IMA/AICA) have mono and stereo (or more) modes, that work slightly differently. In stereo mode the data is so packed together that isn't considered interleaved any more.

For example for ADPCM it could mean the first 0x08 is config for each channel then half a byte is one channel and half the other. Similarly MP3 can work in mono or (joint) stereo, a few crazy games also interleave mono MP3s instead of using regular stereo too.

It's even possible to combine stereo modes and interleave(ex. 2ch 0x1000 + 2ch 0x1000 + 2ch 0x1000) but those are rare and not directly configurable in GENH due to various complexities.


To further complicate matters some codecs (ex. MSADPCM, MS-IMA) have a "frame size" (or block size), as in chunk sizes that can be decoded, which vgmstream calls interleave too (I'm debating if I should change them to use frame_size for clarity).
by Nicknine at 6:48 AM EDT on April 22, 2018
Hmm, that explains it, it's good to know all of that. Thank you for educating me.


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source