pipedog is an unofficial community port of Pipecat, not affiliated with Daily.
pipedog
Speech-to-text

Speechmatics

Realtime speech-to-text with Speechmatics, with diarization and server-side turn detection.

Overview

SpeechmaticsSTTService speaks Speechmatics' Agent STT WebSocket protocol (/v2/agent). pipedog implements the protocol directly (src/agent_stt.ts) instead of depending on the Python-only speechmatics-rt SDK.

Installation

bun add @pipedog/speechmatics

Prerequisites

  • A Speechmatics API key, passed as apiKey or read from SPEECHMATICS_API_KEY. baseUrl defaults to wss://eu2.rt.speechmatics.com/v2/agent (or SPEECHMATICS_RT_URL).

SpeechmaticsSTTService

Configuration

Prop

Type

Settings

Runtime-updatable settings, passed as settings: new SpeechmaticsSTTService.Settings({...}). Settings you leave out keep their defaults.

SettingDefaultDescription
model"linden-1"Speechmatics model.
language, domainLanguage and domain.
turnDetectionModeEXTERNALVAD hands turn detection to the server.
speakerActiveFormat"{text}"Template with {speaker_id}, {text}, {ts}, {lang}. Applies live.
enableDiarization, speakerSensitivity, maxSpeakers, preferCurrentSpeaker, knownSpeakersDiarization.
additionalVocab, enablePartials, emitSentences, punctuationOverrides, transcriptFilteringConfigTranscript shaping.

Changing any setting other than speakerActiveFormat reconnects.

Usage

stt.ts
import { Language } from "@pipedog/core/transcriptions/language";
import { SpeechmaticsSTTService, TurnDetectionMode } from "@pipedog/speechmatics/stt";

const stt = new SpeechmaticsSTTService({
  apiKey: process.env.SPEECHMATICS_API_KEY ?? "",
  settings: new SpeechmaticsSTTService.Settings({
    language: Language.EN,
    turnDetectionMode: TurnDetectionMode.EXTERNAL,
    enableDiarization: true,
    speakerActiveFormat: "@{speaker_id}: {text}",
  }),
});

Notes

  • Event: on_speakers_result.
  • A refused handshake status is hidden by the standard WebSocket on Bun, Node and Deno, so an invalid key is retried 3 times and then reported as a permanent failure.

Runtimes

RuntimeWorksWhat it needs
Bun✅ yesNothing.
Node.js✅ yesNothing.
Deno✅ yesNothing.
Cloudflare Workers✅ yesNothing.

Generated from pipecat.runtimes and pipecat.compat in packages/speechmatics/package.json: ✅ means the compat smoke test passes on that runtime.

The service uses fetch and the global WebSocket (through core's websocketConnect, which sends the auth header on the handshake on Cloudflare Workers too). Pass no SDK; nothing is Node-only.

pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.

Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).

On this page