|
|
@ -4,6 +4,8 @@ import os
|
|
|
|
import subprocess
|
|
|
|
import subprocess
|
|
|
|
import urllib.request
|
|
|
|
import urllib.request
|
|
|
|
import tarfile
|
|
|
|
import tarfile
|
|
|
|
|
|
|
|
import platform
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Tts:
|
|
|
|
class Tts:
|
|
|
|
def __init__(self, config):
|
|
|
|
def __init__(self, config):
|
|
|
@ -34,8 +36,8 @@ class Tts:
|
|
|
|
os.makedirs(PIPER_FOLDER_PATH, exist_ok=True)
|
|
|
|
os.makedirs(PIPER_FOLDER_PATH, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
# Determine OS and architecture
|
|
|
|
# Determine OS and architecture
|
|
|
|
OS = os.uname().sysname
|
|
|
|
OS = platform.system()
|
|
|
|
ARCH = os.uname().machine
|
|
|
|
ARCH = platform.machine()
|
|
|
|
if OS == "Darwin":
|
|
|
|
if OS == "Darwin":
|
|
|
|
OS = "macos"
|
|
|
|
OS = "macos"
|
|
|
|
if ARCH == "arm64":
|
|
|
|
if ARCH == "arm64":
|
|
|
@ -45,6 +47,12 @@ class Tts:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print("Piper: unsupported architecture")
|
|
|
|
print("Piper: unsupported architecture")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
elif OS == "Windows":
|
|
|
|
|
|
|
|
if ARCH == "AMD64":
|
|
|
|
|
|
|
|
ARCH = "x64"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
print("Piper: unsupported architecture")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
PIPER_ASSETNAME = f"piper_{OS}_{ARCH}.tar.gz"
|
|
|
|
PIPER_ASSETNAME = f"piper_{OS}_{ARCH}.tar.gz"
|
|
|
|
PIPER_URL = "https://github.com/rhasspy/piper/releases/latest/download/"
|
|
|
|
PIPER_URL = "https://github.com/rhasspy/piper/releases/latest/download/"
|
|
|
|