Configure Translation
2026-07-13
Feature Overview
During real-time speech recognition (ASR), you can enable the translation feature to translate recognized audio content into the target language in real-time.
- This feature supports the following two main configuration modes:
- Room-level translation: All streams in the room share one translation configuration.
- Stream-level translation: Set personalized translation configurations for different streams in the room (e.g., different target languages).
- Currently supported translation models include: doubao-seed-translation, Qwen-MT, etc. For translation languages supported by different models, please refer to the official documentation of the corresponding model.
- Supported methods for obtaining translation results:
- Server callback to get translation results.
- Real-time audio/video room signaling (ZEGO Express SDK) callback.
Core Parameter Configuration
Configure parameters when creating a real-time speech recognition task (StartRealtimeASRTask).
| Parameter | Type | Required | Description |
|---|---|---|---|
RoomId | String | Yes | RTC room ID |
RecognitionRange | Int | No | Recognition range. 0: entire room, 1: specified StreamList |
StreamList | array of object | No | List of streams to recognize, effective when RecognitionRange is 1. |
EnableTranslation | Bool | No | Whether to enable translation |
Translation | Object | No | Translation LLM configuration item |
SubtitleType | Int | No | Subtitle delivery type via room signaling, default is 0:
1, 2, or 3 |
Usage Examples
Prerequisites
- Use a translation model supported by ZEGO cloud real-time speech recognition
- Have already activated the translation service and obtained the model's API Key.
Start Recognition Task with Translation and Display Translation Results on Client
Get Translation Results
Get Translation Results via Server (Non-streaming)
Refer to the Receiving Callbacks document to get the Data result when Event is TranslationResult.
(Optional) Display Subtitles on Client
To display translation subtitles, please refer to the Display Subtitles document.
