Add more 55-series examples
Also: - remove unnecessary pass-through `_update_settings` implementation in `FalSTTService` - warn that `AsyncAITTSService` doesn't currently support runtime settings updates - update how `GradiumTTSService._update_settings` checks for voice changes - remove a couple of unnecessary args (because they specified defaults) in other examples
This commit is contained in:
@@ -179,6 +179,20 @@ class AsyncAITTSService(AudioContextTTSService):
|
||||
self._keepalive_task = None
|
||||
self._context_id = None
|
||||
|
||||
async def _update_settings(self, update: TTSSettings) -> dict[str, Any]:
|
||||
"""Apply a settings update.
|
||||
|
||||
Settings are stored but not applied to the active connection.
|
||||
"""
|
||||
changed = await super()._update_settings(update)
|
||||
|
||||
if not changed:
|
||||
return changed
|
||||
|
||||
self._warn_unhandled_updated_settings(changed)
|
||||
|
||||
return changed
|
||||
|
||||
def can_generate_metrics(self) -> bool:
|
||||
"""Check if this service can generate processing metrics.
|
||||
|
||||
|
||||
@@ -251,11 +251,6 @@ class FalSTTService(SegmentedSTTService):
|
||||
"""
|
||||
return language_to_fal_language(language)
|
||||
|
||||
async def _update_settings(self, update: STTSettings) -> dict[str, Any]:
|
||||
"""Apply a settings update."""
|
||||
changed = await super()._update_settings(update)
|
||||
return changed
|
||||
|
||||
@traced_stt
|
||||
async def _handle_transcription(
|
||||
self, transcript: str, is_final: bool, language: Optional[str] = None
|
||||
|
||||
@@ -128,9 +128,8 @@ class GradiumTTSService(InterruptibleWordTTSService):
|
||||
Returns:
|
||||
Dict mapping changed field names to their previous values.
|
||||
"""
|
||||
prev_voice = self._voice_id
|
||||
changed = await super()._update_settings(update)
|
||||
if self._voice_id != prev_voice:
|
||||
if "voice" in changed:
|
||||
await self._disconnect()
|
||||
await self._connect()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user