You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
479 B
Python

import subprocess
from subprocess import Popen
import mouse
import time
is_recording=False
while True:
if mouse.is_pressed(button='left') and not is_recording:
is_recording=True
subprocess.Popen('espeak recording',shell=True)
p=subprocess.Popen('./record.py',shell=True)
#p.wait()
time.sleep(2)
elif mouse.is_pressed(button='left') and is_recording:
is_recording=False
subprocess.Popen('espeak stop recording',shell=True)
p.kill()
#p.wait()
time.sleep(2)