Skip to content
1 min read · 271 words

@nhtio/adk/batteries/tts

Environment-neutral aggregate barrel for bundled TTS (text-to-speech) batteries.

Remarks

The TTS domain is the inverse of the specialists domain: where specialists turn a modality INTO text (STT/OCR/caption), a TTS engine turns text INTO audio. Each engine normalizes an existing text-to-speech API behind one contract — synthesize(text, opts?) → a single @nhtio/adk/batteries/tts/transformers_js!GeneratedMediaOutput (kind: 'audio', mimeType: 'audio/wav', WAV bytes).

This barrel re-exports only the environment-neutral transformers.js engine (Node + browser, ONNX Runtime auto-selected — no WebGPU requirement), so it imports cleanly from either Node or the browser. The node-only OS-native engine is reachable only through its own subpath:

  • @nhtio/adk/batteries/tts/native — node-only (shells out to macOS say / Linux espeak-ng / Windows PowerShell System.Speech; imports node:* builtins).

Deep-import that subpath when you need it; don't expect it to be re-exported here — the same reason the embeddings aggregate excludes its browser-only WebLLM engine.

The shared option base is intentionally model-LESS (BaseTtsAdapterOptions carries only voice/rate) because the native engine has no model concept; each model-backed engine adds its own required model. See @nhtio/adk/batteries/tts/_shared.

References

BaseTtsAdapterOptions

Re-exports BaseTtsAdapterOptions


CreateTransformersJsTtsPipeline

Re-exports CreateTransformersJsTtsPipeline


E_INVALID_TRANSFORMERS_JS_TTS_OPTIONS

Re-exports E_INVALID_TRANSFORMERS_JS_TTS_OPTIONS


E_TRANSFORMERS_JS_TTS_ENGINE_ERROR

Re-exports E_TRANSFORMERS_JS_TTS_ENGINE_ERROR


GeneratedMediaOutput

Re-exports GeneratedMediaOutput


RawAudioLike

Re-exports RawAudioLike


SynthesizeOptions

Re-exports SynthesizeOptions


TransformersJsSynthesizeOptions

Re-exports TransformersJsSynthesizeOptions


TransformersJsTtsAdapter

Re-exports TransformersJsTtsAdapter


TransformersJsTtsAdapterOptions

Re-exports TransformersJsTtsAdapterOptions


TransformersJsTtsDataType

Re-exports TransformersJsTtsDataType


TransformersJsTtsDeviceType

Re-exports TransformersJsTtsDeviceType


TransformersJsTtsModelSource

Re-exports TransformersJsTtsModelSource


transformersJsTtsOptionsSchema

Re-exports transformersJsTtsOptionsSchema


TransformersJsTtsPipeline

Re-exports TransformersJsTtsPipeline


TransformersJsTtsProgressCallback

Re-exports TransformersJsTtsProgressCallback


TransformersJsTtsSpeakerEmbeddings

Re-exports TransformersJsTtsSpeakerEmbeddings


TtsSynthesisResult

Re-exports TtsSynthesisResult


validateTransformersJsTtsOptions

Renames and re-exports validateOptions