-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_webaudio_e2_control.txt
58 lines (52 loc) · 1.16 KB
/
simple_webaudio_e2_control.txt
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
@name Simple WebAudio E2 Control
@inputs B1 B2 Fast Ext:entity
@outputs Play URL:string Pos:vector Volume FadeStart FadeEnd Mono
@persist [Snd1,Snd2]:string
#This links to an SF that only works on TSCM
if(first() | dupefinished()){
function void playsound(Audio:string,Vec:vector,Vol,FadeS,FadeE,MonoEnable){
URL = Audio
Pos = Vec
Volume = Vol
FadeStart = FadeS
FadeEnd = FadeE
Mono = MonoEnable
Play = 1
timer("noplay",10)
}
}
if(clk("noplay")){
Play = 0
}
if(~B1 & B1){
if(Fast == 1){
Snd1 = ""
}
else{
Snd1 = "https://cdn.discordapp.com/attachments/915811722646925312/1191111399791927377/mat.wav"
}
playsound(
Snd1, #URL
Ext:pos(), #Audio Pos
1, #Volume
1000, #Fade Start
2000, #Fade End
1 #Mono. Leave this as 0 unless you get an error when the sound tries to play
)
}
if(~B2 & B2){
if(Fast == 1){
Snd2 = ""
}
else{
Snd2 = "https://cdn.discordapp.com/attachments/915811722646925312/1191111400102301777/demat.wav"
}
playsound(
Snd2,
Ext:pos(),
1,
1000,
2000,
1
)
}