-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwwisebnk.bms
50 lines (48 loc) · 1.21 KB
/
wwisebnk.bms
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
# scan data for wave files
# RIFF and RIFX header supported
# note: There are wave files with a wrong file size after RIFF/RIFX
# This script takes the stream size, adds the header size and writes the correct size after RIFF/RIFX
# (c) 2012-06-26 by AlphaTwentyThree
#
# future update plans:
# - option to also write data between found wave files to disk
# - option to automatically transform the file to a playable or at least decodable format
set OFFTOTAL 0
for i = 0
SavePos OFFSET 0
FindLoc SIZE string "BKHD" 0 ""
if SIZE == ""
cleanexit
endif
math SIZE -= OFFSET
get NAME basename
string NAME += "_"
string NAME += i
string NAME += ".soundbank"
log NAME OFFSET SIZE
set SEARCH OFFSET
math SEARCH += SIZE
if SEARCH == FSIZE
cleanexit
endif
goto SEARCH
SavePos OFFSETB 0
FindLoc SIZEB string "1TAD" 0 ""
if SIZEB == ""
goto SEEK_END 0 SEEK_CUR
SavePos SIZEB
endif
math SIZEB -= OFFSETB
get NAME basename
string NAME += "_"
string NAME += i
string NAME += ".bnk"
log NAME OFFSETB SIZEB
set SEARCHB OFFSETB
math SEARCHB += SIZEB
if SEARCHB == FSIZE
cleanexit
endif
goto SEARCHB
math OFFTOTAL += SEARCHB
next i