2018-07-31 11:09:42 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
import argparse
|
|
|
|
from lasp.lasp_record import Recording
|
|
|
|
from lasp.lasp_avstream import AvStream
|
2018-09-13 11:56:05 +00:00
|
|
|
from lasp.device.lasp_daqconfig import default_soundcard, roga_plugndaq, umik
|
2018-07-31 11:09:42 +00:00
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
description='Acquire data and store a measurement file'
|
|
|
|
)
|
|
|
|
parser.add_argument('filename', type=str,
|
|
|
|
help='File name to record to.'
|
|
|
|
' Extension is automatically added.')
|
|
|
|
parser.add_argument('--duration', '-d', type=float,
|
|
|
|
help='The recording duration in [s]')
|
|
|
|
parser.add_argument('--comment', '-c', type=str,
|
|
|
|
help='Add a measurement comment, optionally')
|
2018-09-13 11:56:05 +00:00
|
|
|
|
|
|
|
device_help = 'DAQ Device to record from'
|
|
|
|
parser.add_argument('--input-daq','-i', help=device_help, type=str,
|
|
|
|
choices=['roga', 'umik', 'default'], default='roga')
|
|
|
|
|
2018-07-31 11:09:42 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2018-09-13 11:56:05 +00:00
|
|
|
device_str = args.input_daq
|
|
|
|
if 'roga' == device_str:
|
|
|
|
device = roga_plugndaq
|
|
|
|
elif 'default' == device_str:
|
|
|
|
device = default_soundcard
|
|
|
|
elif 'umik' == device_str:
|
|
|
|
device = umik
|
|
|
|
|
|
|
|
stream = AvStream(device)
|
2018-07-31 11:09:42 +00:00
|
|
|
rec = Recording(args.filename, stream, args.duration)
|
|
|
|
rec.start()
|
|
|
|
stream.stop()
|