.msadpcm

Codecs, formats, encoding/decoding of game audio, video and music
ponaromixxx
Posts: 176
Joined: Tue Sep 30, 2014 5:59 pm

.msadpcm

Post by ponaromixxx »

Help to remove it as I understood the sound and sounds like another text
ili
Posts: 81
Joined: Wed Sep 17, 2014 2:28 pm

Re: .msadpcm

Post by ili »

Yes look missing header
ponaromixxx
Posts: 176
Joined: Tue Sep 30, 2014 5:59 pm

Re: .msadpcm

Post by ponaromixxx »

Here are some ideas


Code: Select all

get DUMMY long
idstring "RAKI"
goto 0x10
getDstring TYPE 4
get OFFSET long
FindLoc GO string "data" 0 ""
math GO += 8
goto GO
get SIZE long
get CODEC short
get CH short
get FREQ long

set NAME ""
if TYPE == "pcm "
   set BLOCKALIGN 4
   set BITS 16
   callfunction PCM 1
elif TYPE == "adpc"
   set BITS 4
   set INTERLEAVE 0x8c
   set CODEC 0xb
   callfunction GENH 1
endif


startfunction PCM
   endian little
   set PRE SIZE
   math PRE += 0x2c
   putVarChr MEMORY_FILE PRE 0
   log MEMORY_FILE 0 0
   set MEMORY_FILE binary "\x52\x49\x46\x46\x20\xC0\xB1\x00\x57\x41\x56\x45\x66\x6D\x74\x20\x10\x00\x00\x00\x01\x00\x02\x00\x44\xAC\x00\x00\x10\xB1\x02\x00\x04\x00\x10\x00\x64\x61\x74\x61\xFC\xBF\xB1\x00"
   append
   log MEMORY_FILE OFFSET SIZE
   append
   set RIFFSIZE SIZE
   math RIFFSIZE += 36
   set AVGBYTES FREQ
   if CODEC != 2
      math AVGBYTES *= BLOCKALIGN
   endif
   
   putvarchr MEMORY_FILE 0x04 RIFFSIZE long
   putvarchr MEMORY_FILE 0x14 CODEC short          # wFormatTag: Microsoft PCM Format (0x0001)
   putvarchr MEMORY_FILE 0x16 CH short   # wChannels
   putvarchr MEMORY_FILE 0x18 FREQ short   # dwSamplesPerSec
   putvarchr MEMORY_FILE 0x1c AVGBYTES long    # dwAvgBytesPerSec
   putvarchr MEMORY_FILE 0x20 BLOCKALIGN short # wBlockAlign
   putvarchr MEMORY_FILE 0x22 BITS short       # wBitsPerSample
   putvarchr MEMORY_FILE 0x28 SIZE long
   if NAME == ""
      get NAME basename
      string NAME += ".wav"
   endif
   get SIZE asize MEMORY_FILE
   log NAME 0 SIZE MEMORY_FILE
endfunction

startfunction GENH
   get FSIZE asize
   math FSIZE += 0x1000
   putVarChr MEMORY_FILE FSIZE 0
   log MEMORY_FILE 0 0
   putVarChr MEMORY_FILE 0 0x484e4547 long
   putVarChr MEMORY_FILE 0x4 CH long
   putVarChr MEMORY_FILE 0x8 INTERLEAVE long
   putVarChr MEMORY_FILE 0xc FREQ long
   putVarChr MEMORY_FILE 0x10 0xffffffff long
   set SAMPLES SIZE
   math SAMPLES *= 8
   math SAMPLES /= BITS
   putVarChr MEMORY_FILE 0x14 SAMPLES long
   putVarChr MEMORY_FILE 0x18 CODEC long
   math OFFSET += 0x1000
   putVarChr MEMORY_FILE 0x1c OFFSET long
   putVarChr MEMORY_FILE 0x20 0x1000 long
   putVarChr MEMORY_FILE 0x300 FSIZE long
   putVarChr MEMORY_FILE 0x304 0x32304756 long
   putVarChr MEMORY_FILE 0xfff 0 byte
   math FSIZE -= 0x1000
   append
   log MEMORY_FILE 0 FSIZE
   append
   get NAME filename
   string NAME += ".genh"
   get SIZE asize MEMORY_FILE
   log NAME 0 SIZE MEMORY_FILE
endfunction
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: .msadpcm

Post by AlphaTwentyThree »

That's my script. Would be nice to see my user name inside it... ;)
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: .msadpcm

Post by spider91 »

Code: Select all

# 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
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: .msadpcm

Post by spider91 »

Some .bsnd files have bad "data" size. Updated script to avoid that problem.
ili
Posts: 81
Joined: Wed Sep 17, 2014 2:28 pm

Re: .msadpcm

Post by ili »

give me this result with someone can help please
Image

and another file got this
Image
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: .msadpcm

Post by spider91 »

bsnd files must be in the same folder with msadpcm files
ili
Posts: 81
Joined: Wed Sep 17, 2014 2:28 pm

Re: .msadpcm

Post by ili »

thank's for sure i do it
maybie it's because is french voice
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: .msadpcm

Post by spider91 »

send me some samples. I'll take a look.