Meta
Realtime speech-to-text with MetaSTTService, over Meta's Muse Voice WebSocket API.
Overview
MetaSTTService: streams audio over a WebSocket to Meta's realtime transcription endpoint. Cumulative partials becomeInterimTranscriptionFrames; the post-processed text of each segment becomes aTranscriptionFrame.
Upstream page
Pipecat's documentation for the same service.
Source
packages/meta/src/stt.ts.
Meta docs
The realtime voice API reference.
Installation
bun add @pipedog/metaimport { MetaSTTService } from "@pipedog/meta/stt";Prerequisites
- A Meta Model API key from Meta's developer site.
- Pass the key as
apiKey. The examples read it fromMETA_API_KEY.
MetaSTTService
Connects to wss://api.meta.ai/v1/asr/realtime. The key travels in the handshake message as a Bearer token, not in an HTTP header, and the session's configuration is fixed once the server accepts it, so a settings change reconnects.
Configuration
Prop
Type
Settings
Runtime-updatable settings, passed as settings: new MetaSTTService.Settings({...})
(MetaSTTSettings). Any setting you leave out keeps the default below.
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "muse-voice-transcribe-1.0" | Transcription model. |
language | Language | null | Language.EN | Language to bias recognition toward. Leave it and languageBias unset to auto-detect. |
languageBias | Language[] | null | null | Languages to bias toward, for speech that switches between them. Replaces language when set. |
mode | string | "ENDPOINTING" | "ENDPOINTING" (the model marks turn boundaries), "PUSH_TO_TALK" or "DIARIZATION". |
keywords | string[] | null | null | Terms to bias recognition toward. Biasing doesn't guarantee a spelling. |
emitAudioProgress | boolean | false | Have the server report progress for every processed audio chunk. |
zdrOverride | boolean | null | null | true forces metadata-only logging; false allows content retention; null uses the account's setting. |
Usage
import { Language } from "@pipedog/core/transcriptions/language";
import { MetaSTTService } from "@pipedog/meta/stt";
const stt = new MetaSTTService({
apiKey: process.env.META_API_KEY ?? "",
settings: new MetaSTTService.Settings({ language: Language.EN, keywords: ["pipedog"] }),
});Event handlers
| Event | Description |
|---|---|
on_connected | The WebSocket connected. |
on_disconnected | The WebSocket closed. |
Notes
- Audio is sent at 24000 Hz, or 16000 Hz for any other pipeline rate (resampled), the only two rates the API accepts.
- The server's turn boundaries only segment transcripts. The VAD and turn strategies still decide when the user's turn ends.
- Sessions are capped at 60 minutes. The server then closes the socket, and the service reconnects into a fresh one.
| Runtime | Works | What it needs |
|---|---|---|
| Bun | ✅ yes | Nothing. |
| Node.js | ✅ yes | Nothing. |
| Deno | ✅ yes | Nothing. |
| Cloudflare Workers | ✅ yes | Nothing. |
Generated from pipecat.runtimes and pipecat.compat in packages/meta/package.json: ✅ means the compat smoke test passes on that runtime.
Runtime notes
- The WebSocket goes through the core
websocketConnect. It works on Bun, Node, Deno and Cloudflare Workers. - Tested against local WebSocket servers, as upstream's tests do, not against Meta itself.
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).