@igris262626/tts-sdk
v0.1.0
Published
Send text and receive WAV audio from Node or the browser.
Maintainers
Readme
@igris262626/tts-sdk
Send text and receive WAV audio. Node returns a Buffer. The browser build returns a Blob.
Install
npm i @igris262626/tts-sdkSynthesize
import { SpeechClient } from "@igris262626/tts-sdk";
const client = new SpeechClient({
accessToken: "identity-jwt",
domainId: "acme-bank",
baseUrl: "https://unified-api.worktual.com",
});
const audio = await client.synthesize("Hello");The request is POST {baseUrl}/v1/synthesize with JSON { "text": "Hello" }. A failed response throws SpeechError.
Do not ship TTS access credentials in the browser for production apps — prefer a server/BFF.
Test
npm test