On this page

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).

ParameterTypeRequiredDescription
RoomIdStringYesRTC room ID
RecognitionRangeIntNoRecognition range. 0: entire room, 1: specified StreamList
StreamListarray of objectNoList of streams to recognize, effective when RecognitionRange is 1.
EnableTranslationBoolNoWhether to enable translation
TranslationObjectNoTranslation LLM configuration item
SubtitleTypeIntNoSubtitle delivery type via room signaling, default is 0:
  • 0: No delivery
  • 1: Recognition results only (e.g., when a user says "你好" in Chinese, delivers "你好")
  • 2: Translation results only (e.g., when a user says "你好" in Chinese, delivers the translated "Hello")
  • 3: Both recognition and translation results (e.g., when a user says "你好" in Chinese, delivers both "你好" and "Hello")
If client UI needs to display subtitles, it is recommended to set to 1, 2, or 3

Usage Examples

Prerequisites

  1. Use a translation model supported by ZEGO cloud real-time speech recognition
  2. 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.

Previous

Display Subtitles

Next

Accessing Methods