AbsoluteJS

@absolutejs/voice-speechmatics

@absolutejs/voice-speechmaticsv0.0.1-beta.5betaVoice & Media

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

#Installation

BASH
bun add @absolutejs/voice-speechmatics

#Capabilities

Overview

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

Speaks Speechmatics' v2 WebSocket protocol directly: connect → StartRecognition → binary audio frames → AddPartialTranscript / AddTranscript / EndOfTranscript → EndOfStream. No Speechmatics SDK dependency.

Use

For pre-issued JWT tokens (e.g., short-lived browser sessions):

Options

Option — Required — Default — Notes

apiKey / jwt — one of — — — API key or pre-issued JWT; passed as ?jwt= on the WebSocket URL per the Speechmatics protocol.

region — no — eu2 — eu, eu2, usa, or any region prefix that resolves to wss://{region}.rt.speechmatics.com.

Show 8 more

baseUrl — no — wss://{region}.rt.speechmatics.com — Override for private/staging endpoints.

language — no — en — BCP-47 code. Overridden when STTAdapterOpenOptions.languageStrategy fixes a language.

operatingPoint — no — enhanced — enhanced (higher quality) or standard (lower latency).

enablePartials — no — true — Stream partial hypotheses.

diarization — no — — — speaker, channel, channel_and_speaker, or none.

maxDelay, speakerChangeSensitivity, punctuationOverrides — no — — — Forwarded to transcription_config.

connectTimeoutMs — no — 8000 — Time to wait for the RecognitionStarted ACK.

webSocket.factory — no — new WebSocket(url) — Inject a fake socket for tests.

Notes

Audio sent before the RecognitionStarted ACK is buffered and flushed once recognition starts.

AddPartialTranscript → partial event, AddTranscript → final event, EndOfTranscript → endOfTurn.

Punctuation tokens are joined to the preceding word (Hello, world, . → Hello world.).

Show 3 more

Average per-token confidence is lifted onto the transcript.

session.close(reason) sends EndOfStream with the last seq_no and then closes the socket cleanly.

Supported encodings on STTAdapterOpenOptions.format.encoding: pcm_s16le, pcm_f32le, mulaw / pcm_mulaw.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/voice-speechmatics through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/voice-speechmatics version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/voice-speechmatics example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Use

Partial snippet

Working example for Use.

TS
import { voice } from "@absolutejs/voice";
import { speechmatics } from "@absolutejs/voice-speechmatics";

const app = voice({
  stt: speechmatics({
    apiKey: process.env.SPEECHMATICS_API_KEY!,
    region: "eu2", // 'eu' | 'eu2' | 'usa'
    language: "en",
    operatingPoint: "enhanced", // or 'standard' for lower latency
    enablePartials: true,
    diarization: "speaker", // optional
  }),
  // ... tts + other options ...
});

#Use 2

Partial snippet

For pre-issued JWT tokens (e.g., short-lived browser sessions):

TS
speechmatics({ region: "eu2", jwt: shortLivedJwt, language: "en" });

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/voice-speechmatics@absolutejs/voice-speechmatics/manifest@absolutejs/voice-speechmatics/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build ./src/index.ts ./src/manifest.ts --outdir dist --target bun --external @absolutejs/manifest --external '@absolutejs/manifest/*' --external @absolutejs/voice --external '@absolutejs/voice/*' --external @sinclair/typebox --external '@sinclair/typebox/*' && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{js,ts,json,md}"
bun run testbun test
bun run typecheckbun run tsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

6 symbols
speechmaticsexportPermalinkSource
TS
speechmatics
Exported from @absolutejs/voice-speechmatics