Adjusted piper download link for windows

pull/173/head
Martin Moehle 10 months ago
parent 33dac74a33
commit aca34eeece

@ -49,7 +49,7 @@ class Tts:
return
elif OS == "Windows":
if ARCH == "AMD64":
ARCH = "x64"
ARCH = "amd64"
else:
print("Piper: unsupported architecture")
return
@ -57,14 +57,15 @@ class Tts:
PIPER_ASSETNAME = f"piper_{OS}_{ARCH}.tar.gz"
PIPER_URL = "https://github.com/rhasspy/piper/releases/latest/download/"
if OS == "windows":
asset_url = f"{PIPER_URL}{PIPER_ASSETNAME}".replace(".tar.gz", ".zip")
asset_url = f"{PIPER_URL}{PIPER_ASSETNAME}"
if OS == "Windows":
asset_url = asset_url.replace(".tar.gz", ".zip")
# Download and extract Piper
urllib.request.urlretrieve(asset_url, os.path.join(PIPER_FOLDER_PATH, PIPER_ASSETNAME))
# Extract the downloaded file
if OS == "windows":
if OS == "Windows":
import zipfile
with zipfile.ZipFile(os.path.join(PIPER_FOLDER_PATH, PIPER_ASSETNAME), 'r') as zip_ref:
zip_ref.extractall(path=PIPER_FOLDER_PATH)

@ -45,6 +45,10 @@ last_messages = ""
def check_filtered_kernel():
messages = get_kernel_messages()
if messages is None:
return "" # Handle unsupported platform or error in fetching kernel messages
global last_messages
messages.replace(last_messages, "")
messages = messages.split("\n")

Loading…
Cancel
Save