Skip to main content

Overview

MetaSTTService provides real-time speech-to-text using Meta’s Muse Voice WebSocket API. The service streams audio to Meta’s realtime transcription endpoint and emits interim and final transcription frames. The API key is sent in the handshake frame rather than an HTTP header, and the session’s configuration is fixed once the server accepts the handshake, so a settings change triggers a reconnection.

Meta STT API Reference

Pipecat’s API methods for Meta STT

Voice Example

Complete voice bot example with Meta STT

Transcription Example

Transcription-only example with Meta STT

Meta Voice API Documentation

Official Meta Muse Voice API documentation

Installation

Prerequisites

Before using MetaSTTService, you need:
  1. Meta Account: Access to the Meta Model API
  2. API Key: A Meta Model API key for authentication

Required Environment Variables

  • META_API_KEY: Your Meta Model API key

Configuration

str
required
Meta Model API key, sent as a Bearer token in the handshake.
str
default:"wss://api.meta.ai/v1/asr/realtime"
WebSocket endpoint URL for the Meta STT API.
int
default:"None"
Audio sample rate in Hz. When None, uses the pipeline’s configured sample rate. Audio at anything other than 24000 is resampled to 16000, the only other rate the API accepts.
MetaSTTService.Settings
default:"None"
Runtime-updatable settings overriding defaults. See Settings below.
float
default:"META_TTFS_P99"
P99 latency from speech end to final transcript in seconds. Override for your deployment. See https://github.com/pipecat-ai/stt-benchmark

Settings

Runtime-configurable settings passed via the settings constructor argument using MetaSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.

Supported Languages

Meta STT supports 25 languages for recognition biasing: Arabic, Bengali, German, English, Spanish, French, Hebrew, Hindi, Indonesian, Italian, Japanese, Kannada, Korean, Marathi, Malay, Dutch, Polish, Portuguese, Tamil, Telugu, Thai, Tagalog, Turkish, Vietnamese, Mandarin Chinese

Usage

Basic Setup

With Custom Settings

Multilingual Mode

For speech that switches between languages, use language_bias:

Push-to-Talk Mode

For client-controlled turn boundaries:

Notes

  • Endpointing modes: In the default ENDPOINTING mode, the server marks turn boundaries itself, emitting speechStart, cumulative partial transcripts, speechEnd, and finally speechComplete with post-processed text. Those boundaries segment transcripts only — Pipecat’s own VAD and turn strategies still decide when the user’s turn ends. In PUSH_TO_TALK mode, the client controls turn boundaries. In DIARIZATION mode, turns are attributed to speakers.
  • Audio resampling: The API accepts only 16 kHz or 24 kHz audio. Audio at 24 kHz is sent unchanged; any other sample rate is resampled to 16 kHz automatically.
  • Settings updates: Any settings change triggers a reconnection because Meta fixes the session’s configuration when it accepts the handshake.
  • Session duration: Sessions are capped at 60 minutes. The server closes the socket when a session reaches that limit, and the base class reconnects into a fresh one.
  • Language biasing: Meta biases recognition on English language names (e.g., "English", "Mandarin Chinese") rather than codes. An unmapped or unrecognized language degrades to auto-detection.

Event Handlers

Supports the standard service connection events (on_connected, on_disconnected, on_connection_error).