diff --git a/server_microphone.py b/server_microphone.py index 8a739c7..aa6ac97 100644 --- a/server_microphone.py +++ b/server_microphone.py @@ -14,6 +14,9 @@ import time from ledpixels import Pixels pixels = Pixels() import avm_sid +# spawn process for news to run it in a new process +import subprocess + def int_or_str(text): """Helper function for argument parsing.""" @@ -56,6 +59,18 @@ async def run_test(): pixels.wakeup() time.sleep(2) pixels.off() + if "nachrichten" in finalResult and "hex" in finalResult and "result" in finalResult: + pixels.wakeup() + time.sleep(1) + pixels.off() + #os.system('~/tagesschau/start_news.sh') + subprocess.Popen(["sh", "/home/pi/tagesschau/start_news.sh"]) + if "ruhe" in finalResult and "hex" in finalResult: + pixels.wakeup() + time.sleep(1) + pixels.off() + #os.system('~/tagesschau/end_news.sh') + subprocess.Popen(["sh", "/home/pi/tagesschau/end_news.sh"]) async def main(): @@ -74,7 +89,7 @@ async def main(): formatter_class=argparse.RawDescriptionHelpFormatter, parents=[parser]) parser.add_argument('-u', '--uri', type=str, metavar='URL', - help='Server URL', default='ws://IP-DES-VOSK-SERVERS:2700') + help='Server URL', default='ws://192.168.178.15:2700') parser.add_argument('-d', '--device', type=int_or_str, help='input device (numeric ID or substring)') parser.add_argument('-r', '--samplerate', type=int, help='sampling rate', default=16000)