Frogger 2 (.wus)

Codecs, formats, encoding/decoding of game audio, video and music
Xiron
Posts: 104
Joined: Sat Sep 12, 2015 7:09 am

Frogger 2 (.wus)

Post by Xiron »

Files commonly start with "## 00 00 00", bytes 4-B I don't even know what about them, and the next set of bytes, C-21 (usually ending in "da") are usually the same.

I already tried using WUSSoft's WUTG programs which plays .wus audio files (apparently not the right ones). Nothing good happened, I was just greeted with a ??? error box.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Frogger 2 (.wus)

Post by AlphaTwentyThree »

Well, actually this is an archive format. Here's a script for it:

Code: Select all

# extracts the *.wus audio archives of Frogger 2
# written by AlphaTwentyThree
# script for QuickBMS http://quickbms.aluigi.org

get FILES long
get BNAME basename
for i = 1 <= FILES
   get SIZE long
   get CRC long
   get FID long
   get CODEC short
   get CH short
   get FREQ long
   get BLOCKALIGN long
   math BLOCKALIGN /= FREQ
   get UNK short
   get UNK2 short
   set BITS 16
   get DA short # "da"
   savepos OFFSET
   get NAME basename
   string NAME p= "%s_0x%08x.wav" BNAME CRC
   callfunction PCM 1
   math OFFSET += SIZE
   goto OFFSET
next i

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
   
   get WSIZE asize MEMORY_FILE
   log NAME 0 WSIZE MEMORY_FILE
endfunction
Xiron
Posts: 104
Joined: Sat Sep 12, 2015 7:09 am

Re: Frogger 2 (.wus)

Post by Xiron »

I can't extract at the moment, but they do probably contain sound files, correct?
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: Frogger 2 (.wus)

Post by AlphaTwentyThree »

Yep
Xiron
Posts: 104
Joined: Sat Sep 12, 2015 7:09 am

Re: Frogger 2 (.wus)

Post by Xiron »

Awesome, thanks! :D