Monday, May 3, 2010

Reading Outcast SFX files

I've been replaying Outcast for the umpteenth time, courtesy of Good Old Games' rerelease and still enjoy it tremendously. (Here are some of my notes about why Outcast is cool.)

In a previous post I outlined how to read the contents of the game's archive files. Here I'll describe how the audio files are stored.

Audio files have .sfx extensions and there are vast numbers of them. They are compressed using the GSM 06.10 cell phone audio compression standard. All the audio files have a 20-byte header followed by a sequence of 33-byte frames of GSM data. Since this is a cell-phone audio standard, each frame can be decoded independently.

All the headers start with the same 12 bytes: 32 54 76 98 01 00 00 00 00 00 80 3F. After this comes two 4-byte little-endian numbers: the number of bytes of data following the header, which should be divisible by 33; and the sample rate (22050 samples per second in the file I'm looking at).

Each 33-byte frame decodes to 160 16-bit samples, so the compressed data rate is around 4.5 KB per second. I used code by Jutta Degener and Carsten Bormann to decode the frames.

Here's a random snip of dialogue from the game (ilott_found_naarn_g_7-9). Ilott has just learned of his brother's death at the hands of Kroax:



I have not had a chance to play with it, but I suspect that they get some of their “alien voice” sound by monkeying with the parameters of the linear predictive coding used to compress the audio, since it is essentially modeling a vocal tract.

7 comments:

June Herman said...

Hello Mr. Mcneill;
I was hoping to find an email address or some other way of contacting you, but it looks like this will have to do for now.

I'm very interested in being able to convert .sfx files to .wav; it took me the better part of my day to find a solution to properly unpacking the .opk files, only to find another unreadable file format! All the programs I've found online for converting .sfx files are either dead links, or things that don't seem to work properly under Windows 7 64bit, such as sfx2wav, wsfx2wav, and outcastripper.

I make electronic music and have a very vested interest in making the source audio for Outcast sampleable.
I currently have next to no programming knowledge, but am more than willing to build some; in the future I aim to do sound design and scoring for games.

I've downloaded Degenor and Bormann's source code and don't currently have any idea how to approach using it, though given enough time I probably could.
If there are no simple executables for converting .sfx files, will trying to make sense of said code allow me access to the sounds of the game?

Sorry about commenting on something so old! You're practically the only person, from my current google-research, who seems to understand how .sfx files work, especially in how they pertain to Outcast. If you could point me in any sort of direction, that would be so absolutely wonderful :)

-june

James McNeill said...

June,

I attempted to email you the source and executables for decompressing the .sfx files.

Perhaps eventually I will create a Github project for this; it would be nice to have publicly available.

June Herman said...

Thank you for your response; though, I haven't received anything, checking my inbox and spam folders.

Did you send it to juneunit@gmail.com?

CrazyStep said...
This comment has been removed by the author.
CrazyStep said...

James, good afternoon. I am also looking for sfx converter in normal audio format. The same wav. I do a little remake of the game Outcast and not all files can reveal. Can you throw me and this converter? My email: crazystip@gmail.com

James McNeill said...

Sent you the stuff; hope it helps!

Alex Bussenault said...

Good afternoon I'm looking for the same audio file, did it went online?
It not could you also send me the converter? Thanks in advance

my email alexlasher8@gmail.com