From 988a4fe60c067c03432266272284e6841225a6af Mon Sep 17 00:00:00 2001 From: "Matthew D. Scholefield" Date: Fri, 23 Feb 2018 14:35:56 -0600 Subject: [PATCH] Add extra option to precise-collect --- precise/scripts/collect.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/precise/scripts/collect.py b/precise/scripts/collect.py index b7f31ae..5af1813 100644 --- a/precise/scripts/collect.py +++ b/precise/scripts/collect.py @@ -116,9 +116,12 @@ def record_until_key(p, args): def _main(): - args = create_parser(usage).parse_args() + parser = create_parser(usage) + parser.add_argument('file_label', nargs='?', help='File label (Ex. recording-##)') + args = parser.parse_args() show_input() - audio_name = input("Audio name (Ex. recording-##): ") + args.file_label = args.file_label or input("File label (Ex. recording-##): ") + args.file_label = args.file_label + ('' if '#' in args.file_label else '-##') hide_input() p = pyaudio.PyAudio() @@ -131,7 +134,7 @@ def _main(): print('Recording...') d = record_until_key(p, args) - name = next_name(audio_name) + name = next_name(args.file_label) save_audio(name, d, args) print('Saved as ' + name)