Page 1 of 1

Future Shock audio format

Posted: Wed Sep 14, 2022 4:00 am
by numidium3rd
This is a bit of a long shot but has anyone dabbled with reverse-engineering Daggerfall's predecessor Terminator: Future Shock? I'm trying to understand its .RAW sound format but despite also running on XnGine it seems to be very different from Daggerfall's PCM sounds.

Daggerfall's sound is pretty straightforward. It uses 8-bit unsigned samples at 11025hz. If I treat Future Shock's sounds the same way they just sound like garbage. I've tried a few things: signed 8-bit samples, 16-bit samples, 32-bit float samples, even ยต-law and A-law. Nothing sounded right. It might be my imagination but the sounds seem vaguely correct if you listen hard but they're buried under loud electronic screeching. I'm by no means an expert on sound engineering so I'm kind of at a loss here.

Re: Future Shock audio format

Posted: Thu Sep 15, 2022 4:48 am
by Interkarma
I don't know the answer, but check out the work by @Rubikow. He has a decently advanced build of Future Shock in Unity engine, similar to DFU, and might know.

https://twitter.com/Rubikow/status/1441385036385714179

Re: Future Shock audio format

Posted: Thu Sep 22, 2022 5:44 am
by numidium3rd
Thanks for pointing me in Rubikow's direction, Interkarma. That Unity port looks promising though it looks like the last post about it was a while ago. Hope he hasn't abandoned it.

Anyhow, I ended up answering my own question and wanted to share this with anyone who is curious. After fumbling around with the DosBox debugger a bit I discovered that Future Shock's audio files have a noise layer applied to them. I discovered a routine that de-noisifies (if this isn't a term then I'm coining it) them for use with the sound device by iterating backwards through a table of bytes and subtracting each value as it iterates forward through the byte-sized samples of sound data. I presume it goes backwards and subtracts because the process of applying the noise involved iterating forward and adding, hence it being the reverse. When it gets to the beginning of the noise table it loops back to the end and repeats until the whole sound file has been read.

Re: Future Shock audio format

Posted: Thu Sep 22, 2022 6:07 am
by Interkarma
Wow... :o

I'm assuming intended to be a data obfuscation technique. What a bit of luck DF didn't have anything like this.