2018-03-30 18:19:23 -07:00
|
|
|
import os
|
|
|
|
|
2018-04-06 13:58:59 -07:00
|
|
|
|
2018-03-30 18:19:23 -07:00
|
|
|
def play_chord(*nums):
|
|
|
|
commands = [
|
|
|
|
"play",
|
|
|
|
"-n",
|
|
|
|
"-c1",
|
|
|
|
"--no-show-progress",
|
|
|
|
"synth",
|
|
|
|
] + [
|
2018-04-06 13:58:59 -07:00
|
|
|
"sin %-" + str(num)
|
2018-03-30 18:19:23 -07:00
|
|
|
for num in nums
|
|
|
|
] + [
|
2018-04-06 13:58:59 -07:00
|
|
|
"fade h 0.5 1 0.5",
|
2018-12-30 01:27:03 +08:00
|
|
|
">",
|
|
|
|
os.devnull
|
2018-03-30 18:19:23 -07:00
|
|
|
]
|
|
|
|
try:
|
|
|
|
os.system(" ".join(commands))
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2018-04-06 13:58:59 -07:00
|
|
|
|
2018-03-30 18:19:23 -07:00
|
|
|
def play_error_sound():
|
|
|
|
play_chord(11, 8, 6, 1)
|
|
|
|
|
2018-04-06 13:58:59 -07:00
|
|
|
|
2018-03-30 18:19:23 -07:00
|
|
|
def play_finish_sound():
|
2018-04-06 13:58:59 -07:00
|
|
|
play_chord(12, 9, 5, 2)
|