mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Fix how sound files are found
This commit is contained in:
parent
e4f888fbc4
commit
090743aacb
2 changed files with 7 additions and 2 deletions
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue