3b1b-manim/manimlib/utils/sounds.py
Thomas Zhu 47d8caa80e Use os.devnull instead of utils.tex_file_writing.get_null(); also small typos that cause SyntaxError (#382)
* Update tex_file_writing.py

* Change "/dev/null" to os.getnull in utils/sounds.py SoX "play" command

* Fix typo
2018-12-29 09:27:03 -08:00

30 lines
463 B
Python

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",
">",
os.devnull
]
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)