Refactored helpers.py into a folder of various util files

This commit is contained in:
Grant Sanderson
2018-03-30 18:19:23 -07:00
parent 4de2dd1d5a
commit 8fae39fe82
75 changed files with 1009 additions and 911 deletions

26
utils/sounds.py Normal file
View File

@ -0,0 +1,26 @@
import os
def play_chord(*nums):
commands = [
"play",
"-n",
"-c1",
"--no-show-progress",
"synth",
] + [
"sin %-"+str(num)
for num in nums
] + [
"fade h 0.5 1 0.5",
"> /dev/null"
]
try:
os.system(" ".join(commands))
except:
pass
def play_error_sound():
play_chord(11, 8, 6, 1)
def play_finish_sound():
play_chord(12, 9, 5, 2)