XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Sep 20, 2017 4:03 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Tue Apr 07, 2015 3:20 am 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times

I've modified .resources script for WTNO, so now it unpacks game sounds with names. Filenames are splitted into *.index files, so if you want to extract all of them place quickbms, wtno_snd.txt (the script below) and the batch files with this line

Code:
for %%i in (*.index) do quickbms -Y wtno_snd.txt %%i unpackedsounds


into Wolfenstein.The.New.Order\base directory. If you want to extract main sounds or specific language voices just remove # before open commad with respective sound archieve and add it to other lines at the beginning of the script.

Code:
#open FDSE streamed.resources 1 MAIN_SOUND
open FDSE english.streamed 2 ENG_SOUND
#open FDSE french.streamed 3 FRA_SOUND
#open FDSE italian.streamed 4 ITA_SOUND
#open FDSE spanish.streamed 5 SPA_SOUND

endian big
goto 0x24
get files long
get unk long
math TMP = files
math TMP - 1
for i = 0 < files
endian little
get FNsize1 long
getdstring FN1 FNsize1
get FNsize2 long
getdstring FN2 FNsize2
get namesize long
getdstring name namesize
endian big
get offset long
get size long
get zsize long
get unksize long
string FN2 -= ".wav"
string FN2 += ".ogg"

if unksize = 1
   savepos pos
   math pos += 0x10
   goto pos
   get offset long
   get size long
   if MAIN_SOUND = 1
      log FN2 offset size 1
   endif
elif unksize = 4
   savepos pos
   math pos += 0x10
   goto pos
   get offset long
   get size long
   if ENG_SOUND = 1
      log FN2 offset size 2
   endif

   savepos pos
   math pos += 0x10
   goto pos
   get offset long
   get size long
   if FRA_SOUND = 1
      log FN2 offset size 3
   endif

   savepos pos
   math pos += 0x10
   goto pos
   get offset long
   get size long
   if ITA_SOUND = 1
      log FN2 offset size 4
   endif

   savepos pos
   math pos += 0x10
   goto pos
   get offset long
   get size long
   if SPA_SOUND = 1
      log FN2 offset size 5
   endif
   

else
   math unksize *= 0x18
   getdstring unkdata unksize
endif

savepos pos
math pos += 0x5
goto pos

if i != TMP
get filenumber long
endif
next i


You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Tue Apr 07, 2015 1:25 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
Great work. (duplicate file paths in .index files is strange)

Try to use with RAGE, but it fails. As I understand, the reason in another archive method, which probably works directly with streamed.resources.


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Tue Apr 07, 2015 2:03 pm 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times
Researchman wrote:
Great work. (duplicate file paths in .index files is strange)

Try to use with RAGE, but it fails. As I understand, the reason in another archive method, which probably works directly with streamed.resources.


Nothing strange. It uses a lot of same files in each level, so duplicates are normal.

As about Rage the resources archieve is different from WTNO, so it won't work. I'll take a look when get some more free time.


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Wed Apr 08, 2015 11:52 pm 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times
Rage - uses headerless wav adpcm. Filenames are stored into gameresources.resources. To unpack headerless .msadpcm files use sript below. You can choose betwen main sounds and specific language voices at the beginning of the script (just like in Wolfenstein TNO).

Code:
#open FDSE streamed.resources 1 MAIN_SOUND
open FDSE english.streamed 2 ENG_SOUND
#open FDSE french.streamed 3 FRA_SOUND
#open FDSE italian.streamed 4 ITA_SOUND
#open FDSE german.streamed 5 GER_SOUND
#open FDSE spanish.streamed 6 SPA_SOUND
#open FDSE russian.streamed 7 RUS_SOUND
#open FDSE japanese.streamed 8 JAP_SOUND

endian big

get DUMMY long
get FOFFSET long
goto FOFFSET
get FILES long

for i = 0 < FILES

  endian little

  get FILENUM long
  get STRLEN long
  getdstring BLOCKNAME STRLEN
  get STRLEN long
  getdstring VALUE1 STRLEN
  get STRLEN long
  getdstring VALUE2 STRLEN

  endian big

  get OFFSET long
  get SIZE long
  get ZSIZE long
  get EXTRA long

  string VALUE1 -= ".wav"
  string VALUE1 += ".msadpcm"

  if EXTRA = 1

     savePOS POS
     math POS += 0x10
     goto POS
     get OFFSET long
     get SIZE long
     if MAIN_SOUND = 1
        log VALUE1 OFFSET SIZE 1
     endif

  elif EXTRA = 7

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if ENG_SOUND = 1
        log VALUE1 OFFSET SIZE 2
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if FRA_SOUND = 1
        log VALUE1 OFFSET SIZE 3
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if ITA_SOUND = 1
        log VALUE1 OFFSET SIZE 4
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if GER_SOUND = 1
        log VALUE1 OFFSET SIZE 5
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if SPA_SOUND = 1
        log VALUE1 OFFSET SIZE 6
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if RUS_SOUND = 1
        log VALUE1 OFFSET SIZE 7
     endif

     savePOS POS
     math POS += 0x10
     goto POS
     get offset long
     get SIZE long
     if JAP_SOUND = 1
        log VALUE1 OFFSET SIZE 8
     endif

  else
     math EXTRA *= 0x18
     getdstring EXTRADATA EXTRA
  endif

  savePOS POS
  math POS += 0x14
  goto POS

next i

get SIZE asize
savePOS POS

if POS != SIZE
  print "!! other footer data here !!"
endif

print "Completed!!"


To get playable wav adpcm (restore headers) put .idmsa (you can unpack them from gameresources.resources with this script) and .msadpcm files with the same name in same directory and use this script (same thing with main sounds and language voices at the beginning of the script).

Code:
#set SHIFT 0x52 # main sounds
set SHIFT 0xE2 # english sounds
#set SHIFT 0x145 # french sounds
#set SHIFT 0x1A8 # italian sounds
#set SHIFT 0x20B # german sounds
#set SHIFT 0x26E # spanish sounds
#set SHIFT 0x2D1 # russian sounds
#set SHIFT 0x334 # japanese sounds
open FDDE idmsa 0
open FDDE msadpcm 1
idstring "mzrt"
get RIFFSIZE ASIZE 1
math RIFFSIZE += 70
set FMTSIZE long 50
get DATA_SIZE ASIZE 1
Goto SHIFT 0
get CODEC_ID short
get CHANNELS short
get FREQUENCY long
get BPS long
get ALIGN short
get UNKNOWN1 long
get UNKNOWN2 long
get UNKNOWN3 long
get UNKNOWN4 long
get UNKNOWN5 long
get UNKNOWN6 long
get UNKNOWN7 long
get UNKNOWN8 long
get UNKNOWN9 long
putVarChr MEMORY_FILE 78 0
log MEMORY_FILE 0 0
set MEMORY_FILE binary "\x52\x49\x46\x46\x00\x00\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x61\x74\x61\x00\x00\x00\x00"
putVarChr MEMORY_FILE 4 RIFFSIZE long
putVarChr MEMORY_FILE 16 FMTSIZE long
putVarChr MEMORY_FILE 20 CODEC_ID short
putVarChr MEMORY_FILE 22 CHANNELS short
putVarChr MEMORY_FILE 24 FREQUENCY long
putVarChr MEMORY_FILE 28 BPS long
putVarChr MEMORY_FILE 32 ALIGN short
putVarChr MEMORY_FILE 34 UNKNOWN1 long
putVarChr MEMORY_FILE 38 UNKNOWN2 long
putVarChr MEMORY_FILE 42 UNKNOWN3 long
putVarChr MEMORY_FILE 46 UNKNOWN4 long
putVarChr MEMORY_FILE 50 UNKNOWN5 long
putVarChr MEMORY_FILE 54 UNKNOWN6 long
putVarChr MEMORY_FILE 58 UNKNOWN7 long
putVarChr MEMORY_FILE 62 UNKNOWN8 long
putVarChr MEMORY_FILE 66 UNKNOWN9 long
putVarChr MEMORY_FILE 74 DATA_SIZE long
append
log MEMORY_FILE 0 DATA_SIZE 1
append
get NAME BASENAME
string NAME += ".wav"
set FULLSIZE long RIFFSIZE
math FULLSIZE += 8
log NAME 0 FULLSIZE MEMORY_FILE


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Thu Apr 09, 2015 4:06 pm 
Offline
mega-veteran
mega-veteran

Joined: Fri Jun 11, 2010 12:08 pm
Posts: 310
Has thanked: 75 times
Have thanks: 20 times
Thanks for huge help!

Collect and pack basic extractors for all three games in one archive.

See attach in the first post. Readme with thanks included.


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Thu Apr 09, 2015 4:22 pm 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times
I've tried to unpack gameresources.resources from RAGE dlc and scirpt stops working at one moment. Same thing with script for audio, cause its based on rage script v2. Extracted files seems to be good, but that's not all the files, i think. I don't have time now, but maybe next week i'll take a look and try to fix script for dlc.


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Wed Feb 17, 2016 1:53 am 
Offline
ultra-n00b

Joined: Mon Jul 13, 2015 6:49 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
Sorry for bringing this back from the dead but any chance to get the scripts for RAGE working again ? It stops after the extraction at line 23 "getdstring BLOCKNAME STRLEN" with "the requested amount of bytes to allocate is negative". If I use the 4Gb version of QuickBMS, it say "not enough memory".


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Wed Feb 24, 2016 8:30 pm 
Offline
ultra-n00b

Joined: Fri Jul 17, 2015 12:51 am
Posts: 9
Has thanked: 0 time
Have thanks: 0 time
Hello spider91

Could you take a look into Doom BFG Edition? This game use .idwav. Its also msadpcm but with header stored in the file instead outside like Rage. However this header cannot be played without modification. I have add a working header for one file but maybe you can write a working BMS script: http://s000.tinyupload.com/index.php?fi ... 8459561560

thx


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Thu Feb 25, 2016 11:27 am 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times
Shepard62700FR
I don't have much time now, don't even know when i'll be able to take a look.

Raik
I've already done it a month ago, but forgot to post script)

Code:
endian big
log MEMORY_FILE 0 0
set MEMORY_FILE binary "\x52\x49\x46\x46\x00\x00\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x32\x00\x00\x00"
append
log MEMORY_FILE 0x15 0x32
putVarChr MEMORY_FILE 0x46 0x64617461 long
goto 0x47
get OFFSET long
math OFFSET += 0x57
goto OFFSET
get SIZE long
savepos OFFSET
reverselong SIZE
putVarChr MEMORY_FILE 0x4A SIZE long
reverselong SIZE
log MEMORY_FILE OFFSET SIZE
math SIZE += 0x46
reverselong SIZE
putVarChr MEMORY_FILE 0x4 SIZE long
get SIZE asize MEMORY_FILE
get NAME basename
string NAME += ".wav"
log NAME 0 SIZE MEMORY_FILE


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Thu Feb 25, 2016 10:06 pm 
Offline
ultra-n00b

Joined: Fri Jul 17, 2015 12:51 am
Posts: 9
Has thanked: 0 time
Have thanks: 0 time
great, works perfect


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Wed Apr 13, 2016 4:40 pm 
Offline
n00b

Joined: Sun Jun 17, 2012 9:38 am
Posts: 17
Has thanked: 0 time
Have thanks: 0 time
this is kinda old .. sorry .. im a total newb with this.. i wanted to extract the audio in " the evil within" game, every sfx /bgm used .. i tried extracting the .streamed files..but get stuck at .msadpcm.. anyone willing to guide me .. step by step? or teach me what file should i extract?


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Tue Feb 14, 2017 7:15 am 
Offline
n00b

Joined: Sun Mar 21, 2010 5:41 pm
Posts: 16
Has thanked: 5 times
Have thanks: 0 time
Hi Spider91, I'd really appreciate your help in changing script or even making a new one for Rage on PS3! Qartar's rendition of original bms file by WRS works on gameresources.resources from both base & mp folders but your BMS doesn't unpack a single file out of streamed.resources from both aforementioned folders. The error QuickBMS reports is "incomplete input file: can't reach 0xN bytes".
Here're beginning and end cuts from both streamed.resources archives, forgive me they're so different in size. I hope you can help, I can surely wait for you to try & deal with the problem so there's no rush.
Goodbye, take care!


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Mon Jul 10, 2017 6:41 pm 
Offline
ultra-n00b

Joined: Wed Jul 05, 2017 7:15 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
spider91 wrote:
It will restore headers to get playable adpcm .wav's
Code:
# The Evil Within adpcm script (PC)
# Put .bsnd (extracted from .tangoresource) and .msadpcm (extracted from .streamed) files in the same dir and use .bsnd as input
# Written by spider91
# script for QuickBMS http://quickbms.aluigi.org
idstring "bsnf"
get BSND_NAME FILENAME
get WAV_NAME BASENAME
string WAV_NAME -= "_msadpcm"
string WAV_NAME += ".msadpcm"
open FDSE BSND_NAME 0
open FDSE WAV_NAME 1
get RIFFSIZE ASIZE 1
math RIFFSIZE += 70
set FMTSIZE long 50
get DATA_SIZE ASIZE 1
Goto -50 0
get CODEC_ID short
get CHANNELS short
get FREQUENCY long
get BPS long
get ALIGN short
get UNKNOWN1 long
get UNKNOWN2 long
get UNKNOWN3 long
get UNKNOWN4 long
get UNKNOWN5 long
get UNKNOWN6 long
get UNKNOWN7 long
get UNKNOWN8 long
get UNKNOWN9 long
putVarChr MEMORY_FILE 78 0
log MEMORY_FILE 0 0
set MEMORY_FILE binary "\x52\x49\x46\x46\x00\x00\x00\x00\x57\x41\x56\x45\x66\x6d\x74\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x61\x74\x61\x00\x00\x00\x00"
putVarChr MEMORY_FILE 4 RIFFSIZE long
putVarChr MEMORY_FILE 16 FMTSIZE long
putVarChr MEMORY_FILE 20 CODEC_ID short
putVarChr MEMORY_FILE 22 CHANNELS short
putVarChr MEMORY_FILE 24 FREQUENCY long
putVarChr MEMORY_FILE 28 BPS long
putVarChr MEMORY_FILE 32 ALIGN short
putVarChr MEMORY_FILE 34 UNKNOWN1 long
putVarChr MEMORY_FILE 38 UNKNOWN2 long
putVarChr MEMORY_FILE 42 UNKNOWN3 long
putVarChr MEMORY_FILE 46 UNKNOWN4 long
putVarChr MEMORY_FILE 50 UNKNOWN5 long
putVarChr MEMORY_FILE 54 UNKNOWN6 long
putVarChr MEMORY_FILE 58 UNKNOWN7 long
putVarChr MEMORY_FILE 62 UNKNOWN8 long
putVarChr MEMORY_FILE 66 UNKNOWN9 long
putVarChr MEMORY_FILE 74 DATA_SIZE long
append
log MEMORY_FILE 0 DATA_SIZE 1
get NAME BASENAME
string NAME -= "_msadpcm"
string NAME += ".wav"
set FULLSIZE long RIFFSIZE
math FULLSIZE += 8
log NAME 0 FULLSIZE MEMORY_FILE

hi
it is not working

The Evil Within *.streamed files extracted with quickBMS. But *..msadpcm files have been obtained.
help :cry:


Top
 Profile  
 
 Post subject: Re: idTech 5 Audio (.streamed)
PostPosted: Tue Jul 11, 2017 9:51 pm 
Offline
advanced

Joined: Mon Feb 14, 2011 8:09 am
Posts: 78
Has thanked: 18 times
Have thanks: 39 times
Read second line from script, you need *.bsnd extracted from *.tangoresource too, not only *.msadpcm



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group