diff --git a/stackchan_server/ws_proxy.py b/stackchan_server/ws_proxy.py index 5b91482..8bda2f0 100644 --- a/stackchan_server/ws_proxy.py +++ b/stackchan_server/ws_proxy.py @@ -20,7 +20,6 @@ _BASE_DIR = Path(__file__).resolve().parent _RECORDINGS_DIR = _BASE_DIR / "recordings" -_RECORDINGS_DIR.mkdir(parents=True, exist_ok=True) _WS_HEADER_FMT = " VVClient: - return VVClient(base_uri="http://localhost:50021") + voicevox_url = os.getenv("STACKCHAN_VOICEVOX_URL", "http://localhost:50021") + return VVClient(base_uri=voicevox_url) class WsProxy: @@ -77,6 +77,7 @@ def __init__(self, websocket: WebSocket, speech_client: speech.SpeechClient): self.recordings_dir = _RECORDINGS_DIR self._debug_recording = _DEBUG_RECORDING_ENABLED if self._debug_recording: + _RECORDINGS_DIR.mkdir(parents=True, exist_ok=True) self.recordings_dir.mkdir(parents=True, exist_ok=True) self._pcm_buffer = bytearray()