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

vocametrix

v0.1.2

Published

Official JavaScript/TypeScript SDK for the Vocametrix voice analysis API

Downloads

464

Readme

vocametrix

npm version CI License: MIT API docs

Official JavaScript/TypeScript SDK for the Vocametrix API — voice analysis, speech therapy, and acoustic measurement for speech-language pathologists, voice researchers, and developers.

Get an API key

Vocametrix is a commercial API. You need an account to use this SDK.

  • Sign up — create an account and get your API key. New accounts include a free trial (5 minutes of analysis or 5 API credits, whichever comes first) so you can run the quickstart below without entering payment details.
  • Pricing — see plans and rates once your trial is used up.

Once you have a key, every call is one VOCAMETRIX_API_KEY env var away.

Install

npm install vocametrix

Requires Node.js ≥ 18. Works in ESM and CJS projects.

30-second quickstart

export VOCAMETRIX_API_KEY="your-api-key-here"
import { VocametrixClient } from "vocametrix";

const client = new VocametrixClient(); // reads VOCAMETRIX_API_KEY from environment

// AVQI — clinically validated dysphonia score (Maryn & Weenink 2015)
const result = await client.avqi.calculate("vowel.wav");
console.log(result["AVQI"]);    // e.g. 1.8 → normal (threshold: 2.97)
console.log(result["CPP"], result["HNR25"]);

Authentication

Set the VOCAMETRIX_API_KEY environment variable, or pass it explicitly:

import { VocametrixClient } from "vocametrix";

// From env var (recommended — never hardcode keys)
const client = new VocametrixClient();

// Explicit key (e.g. loaded from a secrets manager)
const client2 = new VocametrixClient({ apiKey: "va_..." });

Never hardcode API keys in source code. Use environment variables or a secrets manager.

What's included

| Namespace | What it does | |-----------|-------------| | client.avqi | AVQI dysphonia index (Maryn/Barsties) | | client.dsi | Dysphonia Severity Index | | client.cpp | Cepstral Peak Prominence | | client.hnr | Multi-band Harmonics-to-Noise Ratio | | client.jitterShimmer | Jitter & shimmer (Teixeira & Gonçalves 2014) | | client.vrp | Voice Range Profile (ambitus / glissando) | | client.pronunciation | Pronunciation assessment (30+ locales) | | client.transcription | Async speech-to-text with SSE | | client.tts | Text-to-speech with per-character timing | | client.phoneme | Phoneme detection (French, Estonian) | | client.stuttering | Stuttering classification (async polling) | | client.prosody | Prosody similarity (model vs learner) | | client.egemaps | eGeMAPS 88-feature extraction | | client.soundLevel | Sound level measurement (dB SPL) |

Workflows

Pronunciation assessment

const result = await client.pronunciation.assess(
  "recording.wav",
  "Hello, my name is Alex.",
  "en-US",
);
console.log(result["accuracyScore"], result["fluencyScore"]);
for (const word of result["words"] as Array<Record<string, unknown>>) {
  console.log(word["word"], word["accuracyScore"]);
}

Batch AVQI over a folder

import { readdirSync } from "fs";
import path from "path";

for (const file of readdirSync("./recordings").filter(f => f.endsWith(".wav"))) {
  const result = await client.avqi.calculate(path.join("recordings", file));
  const avqi = result["AVQI"] as number;
  console.log(`${file}: AVQI=${avqi.toFixed(2)} (${avqi < 2.97 ? "Normal" : "Dysphonic"})`);
}

Async transcription with SSE

for await (const event of client.transcription.stream("recording.wav", "en-US")) {
  console.log(event.status, event.progress);
  if (event.isTerminalSuccess) {
    console.log("Transcript:", event.displayText);
  }
}

Error handling

import {
  VocametrixAuthError,       // 401 — bad or missing API key
  VocametrixRateLimitError,  // 429 — SDK retries automatically (up to 3×)
  VocametrixValidationError, // 422 — invalid parameter values
  VocametrixServerError,     // 5xx — SDK retries automatically
} from "vocametrix";

try {
  const result = await client.avqi.calculate("vowel.wav");
} catch (err) {
  if (err instanceof VocametrixRateLimitError) {
    console.error(`Rate limited. Retry after ${err.retryAfter}s`);
  } else if (err instanceof VocametrixAuthError) {
    console.error("Check your API key at https://www.vocametrix.com/registration");
  }
}

The SDK retries 429, 500, 502, 503, 504 with exponential backoff (up to 3 retries). Non-retriable errors (4xx except 429) raise immediately.

Longer examples

See vocametrix-examples for:

  • End-to-end workflow scripts (batch pronunciation, full voice assessment, prosody loops)
  • Jupyter notebooks with cohort visualizations

API reference

Related projects

Part of the Vocametrix ecosystem:

Contributing

git clone https://github.com/pmarmaroli/vocametrix-js
cd vocametrix-js
npm install

# Regenerate the low-level client from the live OpenAPI spec
npm run regenerate

# Type check
npm run typecheck

# Lint
npm run lint

# Build (ESM + CJS + types)
npm run build

# Run unit tests (no API key needed — all mocked)
npm test

The src/_generated/ directory is auto-generated. Do not edit it manually. All hand-written logic lives in src/client.ts, src/namespaces.ts, src/_http.ts, and src/exceptions.ts.

License

The vocametrix SDK is released under the MIT License. You're free to use, modify, and redistribute the SDK source code.

Calling the Vocametrix API with this SDK requires an API key, which is issued with a paid Vocametrix account. The SDK code is free; the service is not. See pricing.