diff --git a/ttstoy/ttstoy.py b/ttstoy/ttstoy.py index 0212d11..b18be7d 100644 --- a/ttstoy/ttstoy.py +++ b/ttstoy/ttstoy.py @@ -1,4 +1,5 @@ import os +import sys import shutil import logging import asyncio @@ -527,10 +528,14 @@ class TtsToy(Cog): log.error(f"Morshu server not found: {server_py}") return False + env = os.environ.copy() + env['PORT'] = str(self.morshu_port) + self.morshu_process = await asyncio.to_thread( subprocess.Popen, - ["python3", "server.py"], + [sys.executable, "server.py"], cwd=str(self.morshu_dir), + env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True