npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vakyam-ai/tts

v0.1.8

Published

Node TypeScript SDK for the Vakyam Text-to-Speech API.

Readme

Vakyam TypeScript SDK

Node TypeScript SDK for the Vakyam Text-to-Speech API.

Install

npm install @vakyam-ai/tts

Requires Node.js 20 or newer.

Clients

Use VakyamAI for normal HTTP calls:

import { VakyamAI } from "@vakyam-ai/tts";

const Vakyam = new VakyamAI({
  apiKey: process.env.VAKYAM_API_KEY!,
});

Use VakyamAIAsync for HTTP streaming and WebSocket streaming:

import { VakyamAIAsync } from "@vakyam-ai/tts";

const Vakyam = new VakyamAIAsync({
  apiKey: process.env.VAKYAM_API_KEY!,
});

By default, the SDK connects to the hosted Vakyam API. If you have a custom deployment, pass baseUrl:

const Vakyam = new VakyamAI({
  apiKey: process.env.VAKYAM_API_KEY!,
  baseUrl: "https://your-api.example.com",
});

List Voices

const voicesByLanguage = await Vakyam.voices.list();
const voicesByName = await Vakyam.voices.list({ groupBy: "voice" });

Use the returned voice_name as voice with its language code in TTS requests. Custom voices use a public ID beginning with vc_.

Generate Text To Speech

import { writeFile } from "node:fs/promises";

const result = await Vakyam.tts.generate({
  text: "வணக்கம்",
  model_id: "raaga-v1",
  voice: "Archana",
  language: "ta-IN",
  output_format: "mp3",
  sample_rate: 24000,
});

await writeFile(`speech.${result.format}`, result.audioBytes);

result.audio is the original base64 API response. result.audioBytes is decoded audio as Uint8Array.

HTTP Streaming

import { createWriteStream } from "node:fs";
import { VakyamAIAsync } from "@vakyam-ai/tts";

const Vakyam = new VakyamAIAsync({
  apiKey: process.env.VAKYAM_API_KEY!,
});

const output = createWriteStream("speech.pcm");

for await (const chunk of Vakyam.tts.stream({
  text: "Hello",
  model_id: "raaga-v1",
  voice: "Archana",
  language: "en-IN",
  output_format: "pcm",
  sample_rate: 24000,
})) {
  output.write(chunk);
}

output.end();

WebSocket Streaming

import { writeFile } from "node:fs/promises";
import { VakyamAIAsync } from "@vakyam-ai/tts";

const Vakyam = new VakyamAIAsync({
  apiKey: process.env.VAKYAM_API_KEY!,
});

const socket = await Vakyam.tts.websocket({
  model_id: "raaga-v1",
  voice: "Archana",
  language: "en-IN",
  output_format: "pcm",
  sample_rate: 24000,
});

const utterance = await socket.sendText("Hello.");
await writeFile("speech.pcm", utterance.audioBytes);

socket.close();

Send one complete sentence or utterance per sendText() call.

To interrupt a currently streaming utterance, call cancel(). It resolves after the API sends its cancellation terminal message and includes any audio chunks that arrived before cancellation. The socket remains usable for the next turn.

const turn = socket.sendText("A longer sentence that may be interrupted.");
const cancelled = await socket.cancel();
console.log(cancelled.characters_used, cancelled.audioBytes);
await turn; // resolves with the same cancellation result

Errors

import {
  VakyamAPIError,
  VakyamValidationError,
  VakyamWebSocketError,
} from "@vakyam-ai/tts";

try {
  await Vakyam.tts.generate({
    text: "Hello",
    model_id: "raaga-v1",
    voice: "Archana",
    language: "en-IN",
    sample_rate: 24000,
  });
} catch (error) {
  if (error instanceof VakyamValidationError) {
    console.error(error.field, error.message);
  } else if (error instanceof VakyamAPIError) {
    console.error(error.statusCode, error.code, error.message);
  } else if (error instanceof VakyamWebSocketError) {
    console.error(error.code, error.message);
  } else {
    throw error;
  }
}

Supported Methods

await Vakyam.voices.list();
await Vakyam.voices.list({ groupBy: "voice" });
await Vakyam.tts.generate({...});

for await (const chunk of Vakyam.tts.stream({...})) {}
const socket = await Vakyam.tts.websocket({...});