Real-time speech-to-text translation
Stream transcripts and translated text mid-sentence over a WebSocket for low-latency live translation.
Overview
Soniox real-time speech-to-text translation is the live-streaming delivery mode of Speech-to-text translation. It streams transcripts and translations together over a single WebSocket connection, producing translation tokens mid-sentence, word by word, so you can render them to users without waiting for the speaker to finish.
Use it for live captions, multilingual voice agents, conference interpretation, customer support, and any application where every extra hundred milliseconds matters.
Need to translate recorded files instead? See Async speech-to-text translation.
How real-time streaming works
- Always transcribes speech: every spoken word is transcribed, regardless of translation settings.
- Translates as you go: translation tokens stream alongside the transcript, chunk by chunk.
- Low latency: translation can begin before the sentence ends, so you can render translated tokens as they arrive.
- Unified token stream: transcription and translation tokens arrive together over the same WebSocket, each tagged with
translation_status.
Example
Speaker says:
The token stream contains both original and translated tokens:
- Transcription tokens arrive first, as soon as words are recognized.
- Translation tokens follow, chunk by chunk, without waiting for the full sentence.
See token format for the full token schema and a complete two-way translation example.
Transcription and translation chunks follow each other, but tokens are not 1-to-1 mapped and may not align.
Translation modes
Real-time supports both translation modes:
- One-way translation: detected speech to one target language. Live captions, broadcasts, multilingual meetings.
- Two-way translation: bidirectional between two languages. Bilingual conversations, live interpreters, voice agents.
Quickstart
Add a translation block to your existing real-time session config. The rest
of the streaming setup (audio capture, events, lifecycle) is identical to
real-time transcription.
Timestamps in real-time
- Spoken tokens (
translation_status: "none"or"original") includestart_ms/end_msthat align to the exact position in the audio. - Translated tokens do not include timestamps. They are generated after their spoken tokens and follow the same sequence.
This way you can align transcripts to the original audio while translations stream naturally in sequence.
Supported languages
Real-time speech-to-text translation uses the Soniox supported-language set. See Supported languages for language codes and coverage notes. You can also provide custom translation terms in the context to improve translation accuracy.
Runnable examples
Prerequisite: Complete the steps in Get started.
See on GitHub: soniox_sdk_realtime.py.