Dead Space Audio File.
-
- mega-veteran
- Posts: 278
- Joined: Thu Apr 17, 2008 3:48 am
- Has thanked: 47 times
- Been thanked: 38 times
Re: Dead Space Audio File.
Very interested in this aswell, there are refrences to SBNK's in the str files, and I can't figure out if it's compressed or just an uncommon format.
btw, TrID says it's a generic xbase database, but I think it just doesnt have the right definitions for this type of file.
btw, TrID says it's a generic xbase database, but I think it just doesnt have the right definitions for this type of file.
-
- mega-veteran
- Posts: 278
- Joined: Thu Apr 17, 2008 3:48 am
- Has thanked: 47 times
- Been thanked: 38 times
Re: Dead Space Audio File.
I highly doubt they would use true speech, it's primary use is very compact and "emotionless" speech. it does some special thing with tones to make it smaller and sound bland. it also is a very bad choice for a horror game where everybody's screaming and shooting. i think it's more suited for text to speech apps and other things.
-
- VVIP member
- Posts: 689
- Joined: Fri Jul 04, 2003 6:11 pm
- Has thanked: 33 times
- Been thanked: 16 times
Re: Dead Space Audio File.
STR can refer to "Stream" and "SBNK" is most often a reference to "Sound Bank". I'll give a look-see.
I can hear music when trying to read it as raw music but it is too noisy. A little more would need to be done to convert this properly.
I can hear music when trying to read it as raw music but it is too noisy. A little more would need to be done to convert this properly.
-
- mega-veteran
- Posts: 278
- Joined: Thu Apr 17, 2008 3:48 am
- Has thanked: 47 times
- Been thanked: 38 times
Re: Dead Space Audio File.
Code: Select all
01252 case CODEC_ID_ADPCM_EA_R1:
01253 case CODEC_ID_ADPCM_EA_R2:
01254 case CODEC_ID_ADPCM_EA_R3: {
01255 /* channel numbering
01256 2chan: 0=fl, 1=fr
01257 4chan: 0=fl, 1=rl, 2=fr, 3=rr
01258 6chan: 0=fl, 1=c, 2=fr, 3=rl, 4=rr, 5=sub */
01259 const int big_endian = avctx->codec->id == CODEC_ID_ADPCM_EA_R3;
01260 int32_t previous_sample, current_sample, next_sample;
01261 int32_t coeff1, coeff2;
01262 uint8_t shift;
01263 unsigned int channel;
01264 uint16_t *samplesC;
01265 const uint8_t *srcC;
01266
01267 samples_in_chunk = (big_endian ? bytestream_get_be32(&src)
01268 : bytestream_get_le32(&src)) / 28;
01269 if (samples_in_chunk > UINT32_MAX/(28*avctx->channels) ||
01270 28*samples_in_chunk*avctx->channels > samples_end-samples) {
01271 src += buf_size - 4;
01272 break;
01273 }
01274
01275 for (channel=0; channel<avctx->channels; channel++) {
01276 srcC = src + (big_endian ? bytestream_get_be32(&src)
01277 : bytestream_get_le32(&src))
01278 + (avctx->channels-channel-1) * 4;
01279 samplesC = samples + channel;
01280
01281 if (avctx->codec->id == CODEC_ID_ADPCM_EA_R1) {
01282 current_sample = (int16_t)bytestream_get_le16(&srcC);
01283 previous_sample = (int16_t)bytestream_get_le16(&srcC);
01284 } else {
01285 current_sample = c->status[channel].predictor;
01286 previous_sample = c->status[channel].prev_sample;
01287 }
01288
01289 for (count1=0; count1<samples_in_chunk; count1++) {
01290 if (*srcC == 0xEE) { /* only seen in R2 and R3 */
01291 srcC++;
01292 current_sample = (int16_t)bytestream_get_be16(&srcC);
01293 previous_sample = (int16_t)bytestream_get_be16(&srcC);
01294
01295 for (count2=0; count2<28; count2++) {
01296 *samplesC = (int16_t)bytestream_get_be16(&srcC);
01297 samplesC += avctx->channels;
01298 }
01299 } else {
01300 coeff1 = ea_adpcm_table[ *srcC>>4 ];
01301 coeff2 = ea_adpcm_table[(*srcC>>4) + 4];
01302 shift = (*srcC++ & 0x0F) + 8;
01303
01304 for (count2=0; count2<28; count2++) {
01305 if (count2 & 1)
01306 next_sample = (int32_t)((*srcC++ & 0x0F) << 28) >> shift;
01307 else
01308 next_sample = (int32_t)((*srcC & 0xF0) << 24) >> shift;
01309
01310 next_sample += (current_sample * coeff1) +
01311 (previous_sample * coeff2);
01312 next_sample = av_clip_int16(next_sample >> 8);
01313
01314 previous_sample = current_sample;
01315 current_sample = next_sample;
01316 *samplesC = current_sample;
01317 samplesC += avctx->channels;
01318 }
01319 }
01320 }
01321
01322 if (avctx->codec->id != CODEC_ID_ADPCM_EA_R1) {
01323 c->status[channel].predictor = current_sample;
01324 c->status[channel].prev_sample = previous_sample;
01325 }
01326 }
01327
01328 src = src + buf_size - (4 + 4*avctx->channels);
01329 samples += 28 * samples_in_chunk * avctx->channels;
01330 break;
-
- double-veteran
- Posts: 842
- Joined: Sun Apr 20, 2008 2:58 am
- Has thanked: 5 times
- Been thanked: 33 times
Re: Dead Space Audio File.
Yes but the problem is that these type of R3 files are headerless, FFMPG only supports EA ADPCM with a header, but im not to sure,
Code: Select all
00000000 03 00 00 08 00 FA 00 00 20 00 00 00 00 00 00 00 ........ .......
00000010 04 1C BB 80 60 2E E0 00 00 00 00 00 00 00 00 00 ....`...........
00000020 00 00 07 28 00 00 01 80 A1 F8 05 00 A2 07 05 08 ...(............
00000030 B2 EF 26 EE 12 F8 16 FA 0F 10 3E 13 00 10 EF 22 ..&.......>...."
00000040 22 1F 00 FE 10 F1 DD 3E 0E 00 0E D0 FE 10 C0 22 "......>......."
00000050 DD FE 35 01 EE 01 FC 14 FF 0F DD 0C 01 13 00 CE ..5.............
00000060 12 EE FE 21 32 0F CE 0D 12 FF 43 24 32 0B 21 53 ...!2.....C$2.!S
00000070 34 F0 FF 33 F1 FC 06 00 32 07 76 08 02 F4 16 F3 4..3....2.v.....
00000080 82 04 F5 05 0F FF 04 0C 00 00 1E E3 22 1F 10 00 ............"...
00000090 10 D1 76 03 FF 50 1E 33 FF DB 43 FD FD 0E DE C2 ..v..P.3..C.....
000000A0 ED BC DF 32 DC FE 00 FE F2 FF 02 00 22 CD 11 21 ...2........"..!
000000B0 22 32 CD FF 13 50 35 03 56 E0 20 4E 47 2F CF F1 "2...P5.V. NG/..
000000C0 D0 FF 55 00 A1 00 C4 FF B1 FB F4 FE F1 FC 14 FF ..U.............
000000D0 0F 11 1E 12 E0 0D 21 FC F3 33 EF 42 5F D1 10 D1 ......!..3.B_...
000000E0 C0 00 E1 00 1F 0E 1E 10 0F F1 10 02 13 FF E2 1E ................
000000F0 DE 40 0B 10 2C E1 24 C2 D0 00 E0 2F F0 1F 1D 12 .@..,.$..../....
00000100 0B 02 C3 FF EE 1D 0E 20 F2 FE 10 01 81 FF 65 01 ....... ......e.
00000110 21 01 C4 00 41 00 75 FC E1 00 45 00 C1 21 E1 13 !...A.u...E..!..
00000120 D2 D1 1E E5 40 5C 03 3B FF E4 0B 01 10 FE 05 3F ....@\.;.......?
00000130 E0 0F C1 E0 2F 11 2B 30 0C F0 40 C4 11 0F B3 ED ..../.+0..@.....
00000140 B2 01 4E 50 01 11 01 F2 2C F0 D1 31 24 1F 0D F1 ..NP....,..1$...
00000150 E5 E0 22 02 DF D0 10 0B B1 FF D6 00 C2 00 E7 00 ..".............
00000160 02 01 78 00 22 F9 77 F9 DC 02 4E 20 02 E0 F7 31 ..x.".w...N ...1
00000170 23 0E C7 20 02 1E BE 02 FF 01 BC 0D FE 22 FF FC #.. ........."..
00000180 0D 11 20 D0 FE 30 FF D2 FF FF 11 00 01 C0 EA 2D .. ..0.........-
00000190 10 B2 CF 1E 10 12 A1 01 12 11 D0 2E 00 1F CC 2D ...............-
000001A0 11 1F E1 20 81 FF 36 01 42 FF 78 FF 82 FE F7 FD ... ..6.B.x.....
-
- mega-veteran
- Posts: 278
- Joined: Thu Apr 17, 2008 3:48 am
- Has thanked: 47 times
- Been thanked: 38 times
Re: Dead Space Audio File.
http://wiki.multimedia.cx/index.php?tit ... udio_Codec
appearently it's XAS. and headerless versions have the headers stored elsewhere in the data.
appearently it's XAS. and headerless versions have the headers stored elsewhere in the data.
-
- double-veteran
- Posts: 842
- Joined: Sun Apr 20, 2008 2:58 am
- Has thanked: 5 times
- Been thanked: 33 times
Re: Dead Space Audio File.
HMM interesting.
Kataah a member that studied the file says that it has certain properties to ogg codec. and that the stream is also interleaved, its very complicated.
Kataah a member that studied the file says that it has certain properties to ogg codec. and that the stream is also interleaved, its very complicated.
-
- mega-veteran
- Posts: 278
- Joined: Thu Apr 17, 2008 3:48 am
- Has thanked: 47 times
- Been thanked: 38 times
Re: Dead Space Audio File.
lately i've just been looking through the game files for the headers, I've had shit luck, but I havent covered nearly all of it. I'm sure the game has a method for loading the 16byte headers somewhere.
edit: I know what you mean, XAS has 16 byte headers then 76byte data chunks alternating between the channels or something.
edit: I know what you mean, XAS has 16 byte headers then 76byte data chunks alternating between the channels or something.