Skip to content

NeuralSpeechBootstrapOptions

Bootstrap options for one neural speech provider: a developer-supplied speech model package (its speech block names the pipeline, graphs and voices) and the runtime that executes it.

Each entry registers one provider, with id local.onnx.speech.<platform>:<modelPackage.id> (apple, android or web) unless id is set, so one app can register several models side by side. It plays through the platform’s audio output and writes audio/wav artifacts.

  • runtime defaults to "onnx" (ONNX Runtime, every platform). "coreai" runs a format: "coreai" package on Apple Core AI and is iOS only: its provider id defaults to local.coreai.speech.apple:<modelPackage.id>, below iOS 27 the provider reports itself unavailable and routing skips it, and preparing the model on a device needs the app’s consent (autoDownload, or prepare({ allowDownload: true })). configure() rejects "coreai" on Android and the web.
  • autoDownload lets prepare(), explicit or on the first run, start this provider’s download on its own. Off by default, because a download can use mobile data; a single call can still allow one with prepare({ allowDownload: true }).
  • timeoutMs bounds the synthesis until the run commits; a request’s constraints.timeoutMs wins.

On iOS and Android the package’s source names files on the device, see the model file paragraph on OnnxProviderBootstrapOptions. On the web the package files must be reachable by URL (bundled or app_managed): configure() has to stay JSON, so the runtime is chosen by name, and a runtime that reads a package the app installed into OPFS cannot be passed across. The web runtime also needs the optional onnxruntime-web peer dependency, which this plugin does not declare: the app installs it.

optional autoDownload?: boolean

Lets prepare() start this provider’s download on its own. Off by default.


optional id?: string

Provider id. See the id rule above.


modelPackage: ModelPackage

The model package. List a sha256 per file in integrity.checksums; the provider verifies each file before loading it.


optional runtime?: "onnx" | "coreai"

"onnx" (default, every platform) or "coreai" (iOS 27+ only).


optional timeoutMs?: number

Bounds the synthesis until the run commits, in milliseconds.