mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
add option to suppress success/failure sound (#385)
This commit is contained in:
parent
9dafb85bde
commit
4d069db15c
2 changed files with 10 additions and 2 deletions
|
@ -40,6 +40,11 @@ def parse_cli():
|
|||
parser.add_argument("-n", "--start_at_animation_number")
|
||||
parser.add_argument("-r", "--resolution")
|
||||
parser.add_argument("-c", "--color")
|
||||
parser.add_argument(
|
||||
"--no_sound",
|
||||
action="store_true",
|
||||
help="Don't play a success/failure sound",
|
||||
)
|
||||
module_location.add_argument(
|
||||
"--livestream",
|
||||
action="store_true",
|
||||
|
@ -120,6 +125,7 @@ def get_configuration(args):
|
|||
"output_name": output_name,
|
||||
"start_at_animation_number": args.start_at_animation_number,
|
||||
"end_at_animation_number": None,
|
||||
"no_sound": args.no_sound,
|
||||
}
|
||||
|
||||
# Camera configuration
|
||||
|
|
|
@ -136,13 +136,15 @@ def main(config):
|
|||
for SceneClass in get_scene_classes(scene_names_to_classes, config):
|
||||
try:
|
||||
handle_scene(SceneClass(**scene_kwargs), **config)
|
||||
play_finish_sound()
|
||||
if not config["no_sound"]:
|
||||
play_finish_sound()
|
||||
sys.exit(0)
|
||||
except Exception:
|
||||
print("\n\n")
|
||||
traceback.print_exc()
|
||||
print("\n\n")
|
||||
play_error_sound()
|
||||
if not config["no_sound"]:
|
||||
play_error_sound()
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue