SonioxSTT (providers/soniox-stt.ts)

Patter · libraries/typescript/src/providers/soniox-stt.ts · typescript · MIT
voice, Voice / Speech

TypeScript adapter for Soniox real‑time speech‑to‑text via WebSocket, accumulating final tokens.

// Source: https://github.com/PatterAI/Patter | License: MIT | Copyright 2026 Patter Contributors
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Soniox Speech-to-Text adapter for Patter (TypeScript).
 *
 * Pure WebSocket client for the Soniox real-time STT API. Accumulates
 * `is_final` tokens and flushes them on `<end>`/`<fin>` endpoint tokens,
 * mirroring the Python `SonioxSTT` adapter.
 */

import WebSocket from 'ws';
import { getLogger } from '../logger';

const SONIOX_WS_URL = 'wss://stt-rt.soniox.com/transcribe-websocket';

/**
 * Known Soniox real-time STT models.
 *
 * `STT_RT_V5` is the current default (GA 2026-06-16). It is fully
 * API-compatible with v4 — same WebSocket URL, in-band `api_key`, request
 * params and token-stream shape — so adopting it i

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key