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

@absolutejs/voice-soniox

v0.0.1-beta.2

Published

Soniox real-time speech-to-text adapter for @absolutejs/voice

Downloads

263

Readme

@absolutejs/voice-soniox

Soniox real-time speech-to-text adapter for @absolutejs/voice.

Speaks Soniox's real-time WebSocket protocol directly: connect → send a JSON start-config message carrying the api_key and audio shape → stream binary audio frames → consume token-by-token transcript messages with is_final flags → emit partial / final / endOfTurn events. No Soniox SDK dep.

Install

bun add @absolutejs/voice-soniox

@absolutejs/voice is a runtime dependency.

Use

import { voice } from "@absolutejs/voice";
import { soniox } from "@absolutejs/voice-soniox";

const app = voice({
  stt: soniox({
    apiKey: process.env.SONIOX_API_KEY!,
    // optional:
    model: "stt-rt-preview",            // default
    languageHints: ["en", "es"],
    enableLanguageIdentification: true,
    enableSpeakerDiarization: true,
    enableEndpointDetection: true,
    context: "Customer support call about billing.",
  }),
  // ... tts + other options ...
});

For mixed-language callers, pair with languageStrategy:

soniox({
  apiKey,
  enableLanguageIdentification: true,
});
// open(...) with languageStrategy: { mode: 'allow-switching', primaryLanguage: 'en', secondaryLanguages: ['hi'] }

Options

| Option | Required | Default | Notes | | --- | --- | --- | --- | | apiKey | yes | — | Soniox API key (sent in the start-config message body, not as a header). | | model | no | stt-rt-preview | Soniox real-time model id. | | languageHints | no | — | Seed list, overridden when STTAdapterOpenOptions.languageStrategy resolves a list. | | enableLanguageIdentification | no | — | Tag each token with the detected language. | | enableSpeakerDiarization | no | — | Tag each token with a speaker id. | | enableEndpointDetection | no | — | Surface finished: true end-of-utterance hints (→ endOfTurn). | | context | no | — | Context string passed to Soniox to bias recognition. | | clientReferenceId | no | — | Caller-defined id forwarded to Soniox for billing analytics. | | baseUrl | no | wss://stt-rt.soniox.com | Override for staging / enterprise endpoints. | | connectTimeoutMs | no | 8000 | WebSocket open + config timeout. | | webSocket.factory | no | new WebSocket(url) | Inject a fake socket for tests. |

Notes

  • Audio sent before the start-config is sent is buffered and flushed once the socket is open.
  • Tokens are bucketed by is_final per message: non-final tokens combine into a partial event, final tokens into a final event (a single message can produce both).
  • Average per-token confidence is lifted onto the transcript; start_ms / end_ms are forwarded as startedAtMs / endedAtMs; per-token language and speaker are lifted from the first / lead token in the bucket.
  • finished: true messages emit endOfTurn with reason: "vendor".
  • session.close(reason) sends the documented empty-string end-of-stream sentinel and then closes the socket cleanly.
  • Supported encodings on STTAdapterOpenOptions.format.encoding: pcm_s16le, mulaw / pcm_mulaw, alaw / pcm_alaw.