Skip to main content
Version: 0.10.0

Function: createSupertonicTextToSpeech()

createSupertonicTextToSpeech<K>(config, runtime?): Promise<SupertonicTextToSpeech<K>>

Defined in: extensions/speech/tasks/supertonicTextToSpeech.ts:179

Creates a Supertonic Text-to-Speech pipeline.

It validates all 4 sub-model method schemas, pre-allocates static execution tensors, pre-parses voice styles into memory, and registers disposal hooks to release all native resources.

Type Parameters

K

K extends PropertyKey

Voice style keys record constraint.

Parameters

config

SupertonicTtsModel<K>

Supertonic TTS pipeline configuration containing model and asset paths. See SupertonicTtsModel.

runtime?

any

Optional worklet runtime thread on which to run inference.

Returns

Promise<SupertonicTextToSpeech<K>>

A promise resolving to the instantiated SupertonicTextToSpeech runner.

Throws

With code LOAD_FAILED if models, indexer, or voice styles fail to load, or SCHEMA_MISMATCH if model schemas do not match the Supertonic specification.