Update Lmnt TTS to support updating settings dynamically

This commit is contained in:
Paul Kompfner
2026-02-18 14:47:38 -05:00
parent 416e1cf877
commit 0c73b77327
2 changed files with 20 additions and 3 deletions

View File

@@ -8,7 +8,7 @@
import json
from dataclasses import dataclass, field
from typing import AsyncGenerator, Optional
from typing import Any, AsyncGenerator, Optional
from loguru import logger
@@ -207,6 +207,23 @@ class LmntTTSService(InterruptibleTTSService):
await self._disconnect_websocket()
async def _update_settings(self, update: TTSSettings) -> dict[str, Any]:
"""Apply a settings update.
Args:
update: A :class:`TTSSettings` (or ``LmntTTSSettings``) delta.
Returns:
Dict mapping changed field names to their previous values.
"""
changed = await super()._update_settings(update)
if changed:
await self._disconnect()
await self._connect()
return changed
async def _connect_websocket(self):
"""Connect to LMNT websocket."""
try: