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

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:
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:
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:
quickbms.exe -F "{}win_mus{}.wim" 1.bms "C:\Program Files (x86)\Steam\SteamApps\common\DiRT Showdown\audio\dictionaries" c:\dirt_output