API Reference

This page provides API documentation for the supported pipeline-first interface.

Main Classes

KokoroPipeline

Basic Example:

from pykokoro import KokoroPipeline, PipelineConfig

pipe = KokoroPipeline(PipelineConfig(voice="af_bella"))
result = pipe.run("Hello, world!")
print(result.sample_rate)

PipelineConfig

GenerationConfig

Pipeline Helpers

Result and Data Classes

AudioResult

Segment

PhonemeSegment

Trace

Voice Blending

VoiceBlend

from pykokoro import KokoroPipeline, PipelineConfig
from pykokoro.onnx_backend import VoiceBlend

blend = VoiceBlend.parse("af_bella:60,af_sarah:40")
pipe = KokoroPipeline(PipelineConfig(voice=blend))
result = pipe.run("Blended voice example")

Tokenizer

Tokenizer

TokenizerConfig

PhonemeResult

Tokenizer Example:

from pykokoro.tokenizer import Tokenizer

tokenizer = Tokenizer()
phonemes = tokenizer.phonemize("Hello", lang="en-us")
print(phonemes)

Model and Voice Utilities

These utilities live in pykokoro.onnx_backend and are used for model and voice management.

Configuration Helpers

See Also