Fixed bug with checking screen status. And set the filename to be the date of recording.
This commit is contained in:
parent
8b0c6f5020
commit
696e41dd24
@ -20,7 +20,7 @@ def check_usb():
|
|||||||
def check_record_status():
|
def check_record_status():
|
||||||
stream = os.popen('screen -list | grep -c "Pi-ARecord" || true')
|
stream = os.popen('screen -list | grep -c "Pi-ARecord" || true')
|
||||||
output = stream.read()
|
output = stream.read()
|
||||||
if (output.find("1")):
|
if (output.find("1") != -1):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -31,7 +31,10 @@ def record():
|
|||||||
btn_record_var.set('Start Recording')
|
btn_record_var.set('Start Recording')
|
||||||
else:
|
else:
|
||||||
if (check_usb()):
|
if (check_usb()):
|
||||||
os.system('screen -S record -d -m arecord -D plughw:2,0 -f dat -vv /mnt/USB/test_input.wav')
|
record_time = datetime.now().strftime("%m-%d-%Y - %H:%M")
|
||||||
|
file_name = '/mnt/USB/' + record_time + ".wav"
|
||||||
|
command = 'screen -S record -d -m arecord -D plughw:2,0 -f dat -vv /mnt/USB/' + record_time + '.wav'
|
||||||
|
os.system(command)
|
||||||
btn_record_var.set('Stop Recording')
|
btn_record_var.set('Stop Recording')
|
||||||
else:
|
else:
|
||||||
btn_record_var.set('PreSonus N/A')
|
btn_record_var.set('PreSonus N/A')
|
||||||
|
Loading…
Reference in New Issue
Block a user