glamorous-oil-12326
10/20/2025, 11:22 PMtall-airline-16756
10/20/2025, 11:22 PMtall-airline-16756
10/20/2025, 11:23 PMglamorous-oil-12326
10/20/2025, 11:24 PMtall-airline-16756
10/20/2025, 11:25 PMtts_availability_changed events whenever providers become available or unavailable. By listening to these events, you can easily keep track of which providers are currently ready to use.
• Access Internal Provider State: You can also peek into the internal structure of the FallbackAdapter to see the current provider order and their availability. For example, by going through the list of TTS instances and their statuses, you can find the first available provider—that’s your active one!
Here’s a simple example to help you track the active provider:
class ProviderTracker:
def __init__(self, fallback_adapter):
self.fallback_adapter = fallback_adapter
self.current_provider = None
fallback_adapter.on("tts_availability_changed", self._on_availability_changed)
def _on_availability_changed(self, event):
# Update tracking when availability changes
self._update_current_provider()
def _update_current_provider(self):
# Find first available provider
for i, (tts, status) in enumerate(zip(
self.fallback_adapter._tts_instances,
self.fallback_adapter._status
)):
if status.available:
self.current_provider = tts
return
self.current_provider = None
def get_current_provider_info(self):
if self.current_provider:
return {
'provider': self.current_provider.provider,
'label': self.current_provider.label,
'supports_ssml': hasattr(self.current_provider, '_opts') and
getattr(self.current_provider._opts, 'enable_ssml_parsing', False)
}
return None
This setup will let you dynamically keep an eye on the active provider and whether it supports SSML parsing. If you’d like, I’m here to help you with implementing this or configuring SSML parsing for specific providers—just let me know!
Sources: livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p... | ElevenLabs TTS plugin guide | LiveKit Docs