diff --git a/precise/record.py b/precise/record.py index 676fcb0..1b7d052 100755 --- a/precise/record.py +++ b/precise/record.py @@ -6,13 +6,17 @@ sys.path += ['.'] # noqa from subprocess import Popen, PIPE from pyaudio import PyAudio, paInt16 from precise.common import pr - +from argparse import ArgumentParser def main(): + parser = ArgumentParser('Implementation demo of precise-stream') + parser.add_argument('-m', '--model', default='keyword.pb') + args = parser.parse_args() + pa = PyAudio() stream = pa.open(pr.sample_rate, 1, paInt16, True, frames_per_buffer=1024) - proc = Popen(['python3', 'precise/stream.py', 'keyword.pb', '1024'], stdin=PIPE, stdout=PIPE) + proc = Popen(['python3', 'precise/stream.py', args.model, '1024'], stdin=PIPE, stdout=PIPE) print('Listening...') try: