Skip to main content

Voice Management

Preset Voices

list_preset_voices()

voices = tts.list_preset_voices()
# Returns: List[tuple[str, str]] → [(description, voice_id), ...]

get_preset_voice()

voice = tts.get_preset_voice(voice_name: str = None)
# Returns: dict → {"codes": Tensor, "text": str}

Using a Preset Voice

voices = tts.list_preset_voices()
voice = tts.get_preset_voice("bac_si_tuyen")
audio = tts.infer(text="Chào bạn!", voice=voice)

LoRA Adapters

load_lora_adapter()

success = tts.load_lora_adapter(
lora_repo_id: str,
hf_token: str = None,
)

unload_lora_adapter()

success = tts.unload_lora_adapter()

voices.json Format

{
"default_voice": "voice_name",
"presets": {
"voice_name": {
"description": "Description of the voice",
"text": "Transcript of the reference audio",
"codes": [42, 17, 89, 55, ...]
}
}
}