Page 5 of 9

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 10, 2008 2:22 am
by Mirrodin
Same, I've mostly been trying to mod sounds and music for the Splinter Cell series.
I've been successful in extracting from Splinter Cell, Pandora Tomorrow, Chaos Theory, and Double Agent.

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 10, 2008 5:08 pm
by Dinoguy1000
I'm also going to need the actual formats for these files, if any of you could write them up for me...

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 10, 2008 5:14 pm
by OrangeC
Ive gotten Red steel and beowulf to work.

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 10, 2008 8:29 pm
by Zench
Here is the format of the simple streams, together, but you might want to separate them:

Code: Select all

Note: if the version number is 3, then all values in this file are big-endian. If the version is 5, then all values are little-endian.

Header:
byte {1} - Version number (3 or 5)
byte {3} - Unknown
byte {4} - Unknown
uint32 {4} - Unknown
uint16 {2} - Unknown
uint16 {2} - Number of extra uncompressed samples before the data (always 10)
int16 {2} - First left sample for decompression
byte {1} - First left index for decompression
byte {1} - Unknown
int16 {2} - First right sample for decompression
byte {1} - First right index for decompression
byte {1} - Unknown
byte {4} - Unknown

Extra Uncompressed Samples:
if the sound is mono:
int16 {Number of extra uncompressed samples * 2} - Uncompressed samples

if the sound is stereo:
int16 {Number of extra uncompressed samples * 4} - Uncompressed samples

Data:
 byte {?} - Compressed data

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 10, 2008 11:26 pm
by Zench
And here is the format of the old interleaved streams:

Code: Select all

Little-endian

uint32 {4} - Signature (2)
uint32 {4} - Number of Layers (always 3)
uint32 {4} - Total File Size
uint32 {4} - Unknown (always 20)
uint32 {4} - Unknown (always 1104)
uint32 {4} - Average Block Size (always 361)

For Each Block: {
	uint32 {4} - Block Index (begins at 1)
	uint32 {4} - Unknown (always 20)
	
	For Each Layer (Chunk): {
		uint32 {4} - Layer Chunk Size
	}
	
	For Each Layer (Chunk): {
		uint32 {Layer Chunk Size} - Chunk of an Encapsulated UbiSoft Old Simple Stream
	}
}
And the new interleaved streams:

Code: Select all

Little-endian

uint16 {2} - Signature (8)
uint16 {2} - Unknown
uint32 {4} - Unknown
uint32 {4} - Number of Layers
uint32 {4} - Number of Blocks
uint32 {4} - Number of Bytes after This to the Headers
uint32 {4} - The Sum of (Number of Layers * 4) Plus the Header Lengths
uint32 {4} - Average Sum of Chunk Data Lengths

For Each Layer: {
	uint32 {4} - Layer Header Size
}

For Each Layer: {
	uint32 {Layer Header Size} - Header of an Encapsulated Stream (PCM, UbiSoft Simple Stream, Ogg Vorbis)
}

For Each Block: {
	uint32 {4} - Signature (3)
	uint32 {4} - Number of bytes from the start of this block to the next block, 0 if no more blocks
	
	For Each Layer (Chunk): {
		uint32 {4} - Layer Chunk Size
	}
	
	For Each Layer (Chunk): {
		uint32 {Layer Chunk Size} - Chunk of an Encapsulated Stream (PCM, UbiSoft Simple Stream, Ogg Vorbis)
	}
}
I realize that these formats are quite complicated, and I did not explain them very well, so here are some examples: (just the first few blocks)

Re: Splinter Cell 2 .SS0 Music

Posted: Thu Jun 12, 2008 5:17 pm
by OrangeC
Hey zerich have you looked into assassins creed yet?

Re: Splinter Cell 2 .SS0 Music

Posted: Sun Jun 15, 2008 2:04 am
by Zench
Yes, Kataah sent me some files.

Re: Splinter Cell 2 .SS0 Music

Posted: Sun Jun 15, 2008 2:13 am
by OrangeC
Ahh cool, yes he told me its not easy to extract.

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 17, 2008 3:17 am
by Zench
Update on what's coming for version 0.5:
There will be some fixes, and a few new features. Nothing phenomenal, though. Most notably are: automatic mono/stereo detection (I always hated having to specify that), and decompression of raw stream of UbiSoft compressed audio (useful for tinkering). I could add the ability to mix the layers together, if anyone would find that useful. Although not all layers in interleaved streams are meant to be mixed.

Re: Splinter Cell 2 .SS0 Music

Posted: Tue Jun 17, 2008 11:48 am
by OrangeC
Yes cant wait.

Re: Splinter Cell 2 .SS0 Music

Posted: Wed Jun 18, 2008 12:49 am
by Mirrodin
I think for most of us it would be best not to auto-mix the layers.

Re: Splinter Cell 2 .SS0 Music

Posted: Fri Jun 20, 2008 4:47 pm
by Zench
It would work the same as before, but you could specify multiple layers, separated by commas (-l 2,3) and it would mix them. You could also specify all (-l all) to decode all the layers (up to 16). Important note about layers: in version 0.5 the layer numbers will start with 1, not 0 like before.

While I was experimenting with Pandora Tomorrow (modifying the sound files to see what would happen in game), I actually found the flag that indicates whether the sound is mono or stereo. I should have noticed this before. This means that the format specification above should be changed. I also found out that the value of the unknowns doesn't really matter; the sound still plays as it's supposed to. I have not tried any interleaved streams.

Re: Splinter Cell 2 .SS0 Music

Posted: Fri Jun 20, 2008 7:06 pm
by Mirrodin
I see. Have you worked at all with FMOD? I've been looking at the similarities between your posts with this tool to decode and FMOD's standard bank files and how things are allocated. I do know that Ubisoft does use FMOD tool but modifies the code perhaps? I've only used the designer and not the API because i'm not a programmer :P.

Re: Splinter Cell 2 .SS0 Music

Posted: Fri Jun 20, 2008 7:50 pm
by Zench
Mirrodin wrote:I see. Have you worked at all with FMOD? I've been looking at the similarities between your posts with this tool to decode and FMOD's standard bank files and how things are allocated. I do know that Ubisoft does use FMOD tool but modifies the code perhaps? I've only used the designer and not the API because i'm not a programmer .
I downloaded the designer and looked at it, but the things that I have been working with are more low-level than it (I didn't see anything about interleaved streams, though). In the Splinter Cell series UbiSoft doesn't use the FMOD library, but instead Dare Audio. There are some UbiSoft games that use the FMOD library, though. Whether they use the FMOD designer and then convert it to Dare Audio or not I don't know. I could look at the API too.

Re: Splinter Cell 2 .SS0 Music

Posted: Fri Jun 20, 2008 8:12 pm
by Mirrodin
My guess would have been that Ubisoft has been using the API tools to program, I know with Crysis they did absolutely no modification to Fmod's core and use it to it's fullest extent. Ubisoft games have been compiling proprietary format files but use FMOD somewhere in the pipeline. Since Fmod supports the design of "3d" playback it would have been the API that they were using to develop the audio engine.