Fix how sound files are found

This commit is contained in:
Grant Sanderson 2021-01-23 11:02:02 -08:00
parent e4f888fbc4
commit 090743aacb
2 changed files with 7 additions and 2 deletions

View file

@ -36,5 +36,9 @@ def get_vector_image_dir():
return get_directories()["vector_images"]
def get_sound_dir():
return get_directories()["sounds"]
def get_shader_dir():
return get_directories()["shaders"]

View file

@ -1,5 +1,6 @@
import os
from manimlib.utils.file_ops import find_file
from manimlib.utils.directories import get_sound_dir
def play_chord(*nums):
@ -19,7 +20,7 @@ def play_chord(*nums):
]
try:
os.system(" ".join(commands))
except:
except Exception:
pass
@ -34,6 +35,6 @@ def play_finish_sound():
def get_full_sound_file_path(sound_file_name):
return find_file(
sound_file_name,
directories=[os.path.join("assets", "sounds")],
directories=[get_sound_dir()],
extensions=[".wav", ".mp3"]
)