-
Notifications
You must be signed in to change notification settings - Fork 4
/
beep.py
88 lines (74 loc) · 4.99 KB
/
beep.py
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
75
76
77
78
79
80
81
82
83
84
85
86
import sys
if sys.platform == "win32":
import winsound
def beep():
winsound.Beep(2000, 500)
else:
import alsaaudio
import base64
wave = base64.decodestring(
"""UklGRqQMAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YYAMAAApDG5VQ1zBAVqqAaR/
+oBU013VCC+u5aGw881QFWCzD/GwcJ+c7FtMimGFFmG1pp0Q5shIt2LMHGC5fZw64FxEPmSsIlC+
65qM2vw+KWbcKOzDWprF1O04vGY/Ls/JyplcziI0T2ZdNOLOwpkcyXku5GWDOeTT4JltxF4ogWV9
PvXZkZrEvTYjxmUpRIXgQJzyuRAc9WIJSZ3m851wtWMWQ2HiTMDsk58xsRgQcF8kUD7zwqEQreEJ
tlx8VH75SKQjqRgDc1mRWCwAPKjdpZ78PlZmW5QGYqt8o3b2aFN9XZoMca/ToPDva0/mYEUTjLJR
nqjpYEpDYm8ZsbdMnCzjokXXY5wfSbyNmzXdZEHvZNElKcG/mqDXtDzcZfgqscbUmdDRxDbxZrcx
RMv4mIzLcjErZpg2CdLtmd/FpiuzZTo8Btd9mljBDCZGZedAF90cm6+8sR+JZF1GkuPznHq3Nxmp
YqZK6+k0n8iyNxMtYCBP5O/coCCv0QzEXaxSH/bMoueraAYBW1FWcPyDpbGmAgBLWX1aWQPFqdmk
TPkmVDBd4glTrT6iKvPnUB5fIxDesNOfwOw1Tc1gFBZbtVSdzuaCSA9jbRyjuXebUeBPQ+Vk6CIY
v72a8tmoPoNl+SjIw0yaVNQYOhlm8y1qydSZj85zNApnuDRNzgyZPMkpLjBmTDk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ZkM5zNAhnvDRHzhSZM8k/LhVmdzmQ1LCZ
cMNOKEtl0j4v2hSbmb7RIm5kvkNb4DScTrrsHIZjqkec5r+dm7VfFqVhhE1p7ACfm7APECxfj1Bo
84KilqyOCX5cp1Ri+aOkvKllAyNawlfW/3Cniabt/NlWuluCBoKrTqMb9vNSO17EDNyvkKDd785O
bGBCExyzwJ6Z6ZVKBGJyGeS2JZ23489FzGN4H9W7PprF3D1CHmYgJnLBj5qT1587GGYiLHfGI5p/
0e02N2YhMZ7Lspnhy6AxOWYtNsfRPpkYxzYrqmURPCjX0JkMwW4lGGWwQVHdx5ueu84feWOsRiTj
XJ0jtwgaQGK6SmbpkJ6Ls3wTemAjTzzw+p8gr9QLC17SUUf3FKJ3rLoEG10kVEb/CqPmrA==""")
d = alsaaudio.PCM()
d.setchannels(1)
d.setrate(8000)
d.setformat(alsaaudio.PCM_FORMAT_S16_LE)
def beep():
global d
global wave
d.write(wave)