Fixed non-connection issue

pull/236/head
Abdullah Gohar 9 months ago
parent 3fbf2aa362
commit f365b6a515

@ -3,6 +3,7 @@ from dotenv import load_dotenv
load_dotenv() # take environment variables from .env.
import os
import sys
import asyncio
import threading
import pyaudio
@ -58,7 +59,17 @@ CAMERA_WARMUP_SECONDS = float(os.getenv("CAMERA_WARMUP_SECONDS", 0))
# Specify OS
current_platform = get_system_info()
is_win10 = lambda: platform.system() == "Windows" and "10" in platform.version()
def is_win11():
return sys.getwindowsversion().build >= 22000
def is_win10():
try:
return platform.system() == "Windows" and "10" in platform.version() and not is_win11()
except:
return False
print(platform.system(), platform.version())
# Initialize PyAudio
p = pyaudio.PyAudio()

@ -123,6 +123,10 @@ def _run(
stt_service = "local-whisper"
select_local_model()
system_type = platform.system()
if system_type == "Windows":
server_host = "localhost"
if not server_url:
server_url = f"{server_host}:{server_port}"
@ -130,6 +134,8 @@ def _run(
server = True
client = True
def handle_exit(signum, frame):
os._exit(0)

Loading…
Cancel
Save