Back to docsRecipe
Recipe: Realtime audio translate
Stream microphone input through Meridian's realtime translation pipeline. Capture audio, chunk into frames, and receive translated text with sub-second latency.
Endpoint
POST /v1/realtime/translateRequest
WebSocket upgrade with JSON control frames and binary audio chunks.
{
"source_lang": "en",
"target_lang": "es",
"model": "meridian-rt-v1",
"sample_rate": 16000
}Response stream
Partial translations arrive as JSON frames while audio is still streaming.
{
"type": "partial",
"text": "Hola, ¿cómo",
"confidence": 0.94,
"timestamp_ms": 1420
}Quick start
- Open a WebSocket to the endpoint with your API key header.
- Send a control frame specifying source and target languages.
- Stream raw PCM16 audio chunks at 16 kHz.
- Read JSON frames for realtime partial translations.
- Send a close frame to terminate the session.