forked from Vextil/Wwise-Unpacker
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathunpack.bat
74 lines (59 loc) · 1.56 KB
/
unpack.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
set TYPE=%1
echo === Wwise_Unpacker v1.4 ===
echo.
echo == Unpacking to '%TYPE%'
echo.
goto:start
rem ================= Methods
:UNPACK_WAV
rd /s /q dest_raw
rd /s /q dest_wav
mkdir dest_raw > nul 2>&1
mkdir dest_wav > nul 2>&1
echo ---- Running 'quickbms' for PCK: Extract raw files to "dest_raw"
for %%a in ("Game_Files\*.pck") do (
Tools\quickbms.exe -q -k Tools\wwise_pck_extractor.bms "%%a" "dest_raw"
)
echo.
echo ---- Running 'bnkextr' for BNK: Extract raw files to "dest_raw"
for %%b in ("Game_Files\*.bnk") do (
cd dest_raw
..\Tools\bnkextr.exe "..\%%b" > nul
ren *.wav *.wem
cd ..
)
echo.
echo ---- Running 'vgmstream-cli': Convert Wwise to wav in "dest_wav"
for /r "dest_raw" %%c in ("*.wem") do (
echo "%%c => wav"
Tools\vgmstream-cli.exe -o "dest_wav\%%~nc.wav" "%%c" > nul
)
echo.
goto:eof
:UNPACK_MP3
if not exist dest_wav (
call :UNPACK_WAV
)
rd /s /q dest_mp3
mkdir dest_mp3 > nul 2>&1
echo ---- Running 'ffmpeg': Convert to mp3
for /r "dest_wav" %%a in ("*.wav") do (
echo Converting %%~nxa
Tools\ffmpeg.exe -loglevel error -y -i "%%a" -acodec libmp3lame -q:a 0 -y "dest_mp3\%%~na.mp3"
)
echo.
goto:eof
rem ================= Main
:start
if "%TYPE%"=="wav" (
call :UNPACK_WAV
)
if "%TYPE%"=="mp3" (
call :UNPACK_MP3
)
rem ================= Footer
echo -------------------------------------------------------------
echo == Unpack finished! Files should be in the 'dest_%TYPE%' folder
echo -------------------------------------------------------------
pause