KokoroTTS
Python template · sinapsis_kokoro.templates.kokoro_tts
Overview
Template for text-to-speech (TTS) synthesis using the Kokoro 82M v1.0 model. This class handles the initialization of the TTS pipeline, speech generation, and packaging the output audio in the desired format.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-kokoro==1.0.0uv pip install sinapsis-kokoro==1.0.0uv add sinapsis-kokoro==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
The speed at which the speech will be generated. Default is 1 (normal speed).
Optional
Default: 1
The voice model to use for speech synthesis. Default is "af_heart". Notes: The list of languages and voices supported by Kokoro can be found at: https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md
Optional
Default: "af_heart"
Optional
Default: "cpu"
Optional
Default: null
The regular expression pattern used to split the input text into smaller chunks. Default is r" +" (split on newlines).
Optional
Default: "\\n+"
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: KokoroTTS
class_name: KokoroTTS
template_input: InputTemplate
attributes:
speed: 1
voice: af_heartShow schema-based configuration skeleton
templates:
- template_name: "KokoroTTS"
class_name: "KokoroTTS"
attributes:
speed: 1
voice: "af_heart"
device: "cpu"
split_pattern: "\\n+"
Inheritance
sinapsis_core.template_base.template.TemplateEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.