INNER CODE UNIT · Python
get_available_voices
devnen/Kitten-TTS-Server · engine.py:213
def get_available_voices() -> List[str]:
"""Returns the named voice list for the currently loaded model (for UI dropdown)."""
if loaded_model_selector and loaded_model_selector in MODEL_REGISTRY:
return list(MODEL_REGISTRY[loaded_model_selector]["voices"])
# Fallback
return list(_V01_VOICES)
def get_all_accepted_voices() -> List[str]:
"""Returns all accepted voice identifiers (named + internal) for API validation."""
named = get_available_voices()
# Also accept raw internal voice keys (expr-voice-*) for API compatibility
if voices_data is not None:
internal = list(voices_data.keys())
return list(dict.fromkeys(named + internal)) # deduplicated, order preserved
return named