server_microphone.py aktualisiert
This commit is contained in:
@@ -14,6 +14,9 @@ import time
|
|||||||
from ledpixels import Pixels
|
from ledpixels import Pixels
|
||||||
pixels = Pixels()
|
pixels = Pixels()
|
||||||
import avm_sid
|
import avm_sid
|
||||||
|
# spawn process for news to run it in a new process
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def int_or_str(text):
|
def int_or_str(text):
|
||||||
"""Helper function for argument parsing."""
|
"""Helper function for argument parsing."""
|
||||||
@@ -56,6 +59,18 @@ async def run_test():
|
|||||||
pixels.wakeup()
|
pixels.wakeup()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
pixels.off()
|
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():
|
async def main():
|
||||||
|
|
||||||
@@ -74,7 +89,7 @@ async def main():
|
|||||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
parents=[parser])
|
parents=[parser])
|
||||||
parser.add_argument('-u', '--uri', type=str, metavar='URL',
|
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,
|
parser.add_argument('-d', '--device', type=int_or_str,
|
||||||
help='input device (numeric ID or substring)')
|
help='input device (numeric ID or substring)')
|
||||||
parser.add_argument('-r', '--samplerate', type=int, help='sampling rate', default=16000)
|
parser.add_argument('-r', '--samplerate', type=int, help='sampling rate', default=16000)
|
||||||
|
|||||||
Reference in New Issue
Block a user