mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +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("-n", "--start_at_animation_number")
|
||||||
parser.add_argument("-r", "--resolution")
|
parser.add_argument("-r", "--resolution")
|
||||||
parser.add_argument("-c", "--color")
|
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(
|
module_location.add_argument(
|
||||||
"--livestream",
|
"--livestream",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -120,6 +125,7 @@ def get_configuration(args):
|
||||||
"output_name": output_name,
|
"output_name": output_name,
|
||||||
"start_at_animation_number": args.start_at_animation_number,
|
"start_at_animation_number": args.start_at_animation_number,
|
||||||
"end_at_animation_number": None,
|
"end_at_animation_number": None,
|
||||||
|
"no_sound": args.no_sound,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Camera configuration
|
# Camera configuration
|
||||||
|
|
|
@ -136,13 +136,15 @@ def main(config):
|
||||||
for SceneClass in get_scene_classes(scene_names_to_classes, config):
|
for SceneClass in get_scene_classes(scene_names_to_classes, config):
|
||||||
try:
|
try:
|
||||||
handle_scene(SceneClass(**scene_kwargs), **config)
|
handle_scene(SceneClass(**scene_kwargs), **config)
|
||||||
play_finish_sound()
|
if not config["no_sound"]:
|
||||||
|
play_finish_sound()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("\n\n")
|
print("\n\n")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print("\n\n")
|
print("\n\n")
|
||||||
play_error_sound()
|
if not config["no_sound"]:
|
||||||
|
play_error_sound()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue