mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
Added sound to mark when animation finishes
This commit is contained in:
21
helpers.py
21
helpers.py
@ -7,6 +7,7 @@ import random
|
||||
import inspect
|
||||
import string
|
||||
import re
|
||||
import os
|
||||
from scipy import linalg
|
||||
|
||||
from constants import *
|
||||
@ -14,6 +15,26 @@ from constants import *
|
||||
CLOSED_THRESHOLD = 0.01
|
||||
STRAIGHT_PATH_THRESHOLD = 0.01
|
||||
|
||||
def play_chord(*nums):
|
||||
commands = [
|
||||
"play",
|
||||
"-n",
|
||||
"-c1",
|
||||
"synth",
|
||||
] + [
|
||||
"sin %-"+str(num)
|
||||
for num in nums
|
||||
] + [
|
||||
"fade h 0.5 1 0.5"
|
||||
]
|
||||
try:
|
||||
os.system(" ".join(commands))
|
||||
except:
|
||||
pass
|
||||
|
||||
def play_finish_sound():
|
||||
play_chord(12, 9, 5, 2)
|
||||
|
||||
def get_smooth_handle_points(points):
|
||||
num_handles = len(points) - 1
|
||||
dim = points.shape[1]
|
||||
|
Reference in New Issue
Block a user