server_microphone.py aktualisiert

This commit is contained in:
2026-02-04 14:46:01 +00:00
parent a3536c5bd2
commit c8b18b112d

View File

@@ -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)