mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Changed default behavior to have no finishing sound, and instead of passing in --no-sound to prevent the sound, one would pass in --sound to activate it
This commit is contained in:
parent
e957517d7d
commit
d98d1ec610
2 changed files with 5 additions and 5 deletions
|
@ -41,9 +41,9 @@ def parse_cli():
|
||||||
parser.add_argument("-r", "--resolution")
|
parser.add_argument("-r", "--resolution")
|
||||||
parser.add_argument("-c", "--color")
|
parser.add_argument("-c", "--color")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--no_sound",
|
"--sound",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Don't play a success/failure sound",
|
help="Play a success/failure sound",
|
||||||
)
|
)
|
||||||
module_location.add_argument(
|
module_location.add_argument(
|
||||||
"--livestream",
|
"--livestream",
|
||||||
|
@ -128,7 +128,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,
|
"sound": args.sound,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Camera configuration
|
# Camera configuration
|
||||||
|
|
|
@ -136,14 +136,14 @@ 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)
|
||||||
if not config["no_sound"]:
|
if config["sound"]:
|
||||||
play_finish_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")
|
||||||
if not config["no_sound"]:
|
if config["sound"]:
|
||||||
play_error_sound()
|
play_error_sound()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue