@kova-ai/tts is the official JavaScript/TypeScript client. Works in Node 18+. Source: github.com/evalabs-ai/kova-tts-clients.
Install
Initialize
https://api.kova.ai/v1/tts. Override baseUrl for staging or self-hosting:
Sync TTS
result.audio is the decoded audio bytes (Uint8Array), not base64.
Streaming TTS
streamTTS returns an async iterable of events:
WebSocket
Helpers
| Symbol | What it does |
|---|---|
client.writeAudioFile(audio, path) | Write decoded audio bytes to disk. |
decodeBase64ToBytes(value) | Top-level — decode a base64 string to Uint8Array. |
decodePcm16LeBase64(value) | Top-level — decode a base64 PCM16-LE chunk to Int16Array. |
pcm16ToWavBytes(pcm, { sampleRate, channels? }) | Top-level — wrap raw int16 PCM in a WAV header. Returns Uint8Array you write yourself with node:fs/promises. |
listVoices method:
Errors
The SDK throws aKovaTTSError on non-2xx responses. The error carries the HTTP status and the parsed JSON body: