-
Notifications
You must be signed in to change notification settings - Fork 0
/
modRemoveSound.bas
executable file
·57 lines (43 loc) · 1.21 KB
/
modRemoveSound.bas
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
Attribute VB_Name = "Module1"
Dim booStop As Boolean
Type wavriff
char(1 To 4) As Byte
totallen As Long
wve(1 To 4) As Byte
End Type
Type formatwav
char(1 To 4) As Byte
formatlen As Long
dummy As Integer
channels As Integer
sr As Long
bytespersecond As Long
bytespersample As Integer
bitspersample As Integer
char2(1 To 4) As Byte
datalen As Long
End Type
Function LoadWAVheader(Format As WAVEFORMATEX, fn As String, tmp As wavriff, header As formatwav)
ff = FreeFile
Open fn For Binary As #ff
Get #ff, , tmp
Get #ff, , header
Format.lAvgBytesPerSec = header.bytespersecond
Format.lSamplesPerSec = header.sr
Format.nBitsPerSample = header.bitspersample
Format.nBlockAlign = header.bytespersample
Format.nChannels = header.channels
LoadWAVheader = ff
End Function
Function SaveWAVheader(Format As WAVEFORMATEX, fn As String, tmp As wavriff, header As formatwav)
header.bytespersecond = Format.lAvgBytesPerSec
header.sr = Format.lSamplesPerSec
header.bitspersample = Format.nBitsPerSample
header.bytespersample = Format.nBlockAlign
header.channels = Format.nChannels
ff = FreeFile
Open fn For Binary As #ff
Put #ff, , tmp
Put #ff, , header
SaveWAVheader = ff
End Function