-
Notifications
You must be signed in to change notification settings - Fork 72
/
PlaySound.ahk
71 lines (65 loc) · 1.37 KB
/
PlaySound.ahk
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
; LintaList Include
; Purpose: Play sounds
; Version: 1.7
; Date: 20151003
PlaySound(PlaySound,Action)
{
Global
If (PlaySound = 0) ; don't play sounds
Return
else If (PlaySound = 1) ; beeps
{
If (Action = "paste")
PlayBeep(playsound_1_paste)
else If (Action = "open") ; Open GUI
PlayBeep(playsound_1_open)
else If (Action = "close") ; Close Gui
PlayBeep(playsound_1_close)
}
else If (PlaySound = 2) ; default sound files
{
If (Action = "paste") ; paste
{
If playsound_2_paste
SoundPlay, %A_WinDir%\Media\%playsound_2_paste%
}
else If (Action = "open") ; Open GUI
{
If playsound_2_open
SoundPlay, %A_WinDir%\Media\%playsound_2_open%
}
else If (Action = "close") ; Close Gui
{
If playsound_2_close
SoundPlay, %A_WinDir%\Media\%playsound_2_close%
}
}
else If (PlaySound = 3) ; local sound files
{
If (Action = "paste") ; paste
{
If playsound_3_paste
SoundPlay, Extras\sounds\%playsound_3_paste%
}
else If (Action = "open") ; Open GUI
{
If playsound_3_open
SoundPlay, Extras\sounds\%playsound_3_open%
}
else If (Action = "close") ; Close Gui
{
If playsound_3_close
SoundPlay, Extras\sounds\%playsound_3_close%
}
}
}
PlayBeep(in)
{
if (in = "")
return
loop, parse, in, CSV
{
StringSplit, p, A_LoopField, |
SoundBeep, %p1%, %p2%
}
}