DiRT 3(.WIM)

Codecs, formats, encoding/decoding of game audio, video and music
happyend
Posts: 157
Joined: Sun Aug 24, 2014 8:54 am

DiRT 3(.WIM)

Post by happyend »

AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: DiRT 3(.WIM)

Post by AlphaTwentyThree »

I'm also interested in this!
Supposedly the files can by decoded with http://www.moddb.com/games/dirt-3/downl ... audio-tool But the program won't start under Win 8...
voltagex
Posts: 1
Joined: Sat Jun 06, 2015 12:41 am

Re: DiRT 3(.WIM)

Post by voltagex »

I know this is an old topic but:

Code: Select all

 sox -t raw -e mu-law -r 96k _mus_fnd_quad01.ulaw test.wav


Works fine. I didn't even have to cheat and decompile the Ego Audio Tool (although I do wish people would release their source code)

The above sox command is right, but the proper sample rates can be found in the musicPlayer.xml.

See https://github.com/voltagex/Modest/tree/master
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: DiRT 3(.WIM)

Post by AlphaTwentyThree »

Thanks for this vital information! I didn't know what to make of the strange characer distribution of the streams. Now I know that this is μ-Law!:)
In this case you can use my wave header adder from http://forum.xentax.com/viewtopic.php?f ... 565#p71565 (set codec to 7, bits to 8 and blockalign to 2).
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: DiRT 3(.WIM)

Post by aluigi »

Oh, my surprise when I was looking for a way to play the WIM files of DiRT Showdown and found this topic on my forum :D

If you want to play the files directly with sox it's enough to use -d instead of the output file name... just in case someone wants to save space:

Code: Select all

sox -t raw -e mu-law -r 96k YOUR_FILE.WIM -d


Instead if you want to add a RIFF/WAV header to the WIM file for playing them with various media player (for example Winamp or mplayer) you can use this script:

Code: Select all

get SIZE asize
math CHANNELS = 1
math FREQUENCY = 96000
math BITS = 8
get NAME basename
string NAME + ".wav"
callfunction TOWAV_MULAW 1

startfunction TOWAV_MULAW
    set BLOCKALIGN long BITS
    set AVGBYTES long FREQUENCY
    math BLOCKALIGN / 8
    math BLOCKALIGN * CHANNELS
    math AVGBYTES * BLOCKALIGN

    log MEMORY_FILE 0 0
    putdstring "RIFF" 4 MEMORY_FILE
    put 0 long MEMORY_FILE
    putdstring "WAVE" 4 MEMORY_FILE
    putdstring "fmt " 4 MEMORY_FILE
    put 0 long MEMORY_FILE
    put 7 short MEMORY_FILE             # wFormatTag
    put CHANNELS short MEMORY_FILE      # wChannels
    put FREQUENCY long MEMORY_FILE      # dwSamplesPerSec
    put AVGBYTES long MEMORY_FILE       # dwAvgBytesPerSec
    put BLOCKALIGN short MEMORY_FILE    # wBlockAlign
    put BITS short MEMORY_FILE          # wBitsPerSample
    put 0x0 short MEMORY_FILE
    savepos TMP MEMORY_FILE
    math TMP - 0x14
    putvarchr MEMORY_FILE 0x10 TMP long

    putdstring "fact" 4 MEMORY_FILE
    put 4 long MEMORY_FILE
    put SIZE long MEMORY_FILE

    putdstring "data" 4 MEMORY_FILE
    put SIZE long MEMORY_FILE

    get RIFFSIZE asize MEMORY_FILE
    math RIFFSIZE + SIZE
    math RIFFSIZE - 8
    putvarchr MEMORY_FILE 4 RIFFSIZE long
    math RIFFSIZE - SIZE
    math RIFFSIZE + 8
    log NAME 0 RIFFSIZE MEMORY_FILE
    append
    log NAME OFFSET SIZE
    append
endfunction


It's easy to use it in batch with all the files from command-line:

Code: Select all

quickbms.exe -F "{}win_mus{}.wim" 1.bms "C:\Program Files (x86)\Steam\SteamApps\common\DiRT Showdown\audio\dictionaries" c:\dirt_output
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: DiRT 3(.WIM)

Post by aluigi »

Just a small improvement of the previous script.