Skip to main content
Version: 0.10.0

Type Alias: KokoroTextToSpeech<K>

KokoroTextToSpeech<K> = object

Defined in: extensions/speech/tasks/kokoroTextToSpeech.ts:123

Kokoro text-to-speech task runner.

Type Parameters

K

K extends PropertyKey = string

Voice keys record constraint.

Properties

dispose()

readonly dispose: () => void

Defined in: extensions/speech/tasks/kokoroTextToSpeech.ts:127

Releases all allocated native resources.

Returns

void


synthesize()

readonly synthesize: (text, options) => AsyncGenerator<KokoroTtsChunk>

Defined in: extensions/speech/tasks/kokoroTextToSpeech.ts:138

Streams synthesized audio chunks as an async generator as each text chunk finishes.

Parameters

text

string

Input text (or IPA phonemes) to synthesize into speech.

options

KokoroTtsOptions<K>

Per-call execution options. See KokoroTtsOptions.

Returns

AsyncGenerator<KokoroTtsChunk>

An AsyncGenerator yielding KokoroTtsChunk audio buffers.

Throws

With code INVALID_ARGUMENT if the voice is unknown or speed is out of range, RESOURCE_BUSY if the model is in use, or RESOURCE_DISPOSED if disposed.


synthesizeStop()

readonly synthesizeStop: () => void

Defined in: extensions/speech/tasks/kokoroTextToSpeech.ts:144

Cancels any in-flight synthesis started by synthesize.

Returns

void