ASR
Feature Overview
In Cascade (Three-Stage) mode, Automatic Speech Recognition (ASR) is the first step in the conversation pipeline. The AI backend subscribes to user audio streams in the room, transcribes speech to text in real time, and forwards the transcribed text to the large language model (LLM) for inference.
The ASR stage uses a
Provider + Params integration pattern and supports:TRTC Proprietary ASR (
trtc, default): Ready to use without additional setup. No need to configure third-party services. Recommended for most use cases.Third-Party ASR (e.g., Microsoft Azure): Use when you require a specific recognition engine or language.
Note:
In S2S (End-to-End) mode, user audio is sent directly to an end-to-end speech model. There is no separate ASR stage, and
STTConfig is not required. Currently, Microsoft Azure is supported as a third-party provider. For integration with other ASR vendors, please contact sales.Configuration Structure
To configure ASR for an AI conversation task, set the
STTConfig field:Field Name | Required | Type | Description |
Provider | Yes | String | ASR provider identifier: trtc (default); azure. |
Params | Yes | String | Provider-specific parameters, formatted as a JSON string |
TRTC Proprietary ASR
Params Field Specification (Provider = trtc)
Field Name | Type | Required | Description |
engine_model_type | String | Yes | ASR model type, e.g., bigmodel. We strongly recommend the bigmodel series. See engine_model_type and language details. |
language | String | No | Recognition language. Should match the language identifier in engine_model_type, e.g., zh or en. |
vad_silence_time | Integer | No | VAD silence endpoint duration (ms), range 200–2000, default 1000. Lower values speed up segmentation but may misinterpret pauses as speech end. |
max_speak_time | Integer | No | Maximum utterance duration (ms), range 10000–90000, default 60000. Longer sentences are forcibly segmented. |
engine_model_type and language Specification
The
engine_model_type field defines the ASR model. Supported engines include:Engine Value | Description |
bigmodel | Large model engine (recommended) |
16k_zh_en | Standard engine, 16k Chinese-English model. Supports Mandarin, English, and several Chinese dialects. |
Supported language codes for the
language field:Language Code | Language | Language Code | Language |
zh | Chinese | tr | Turkish |
en | English | hi | Hindi |
yue | Cantonese | ms | Malay |
ar | Arabic | nl | Dutch |
de | German | sv | Swedish |
fr | French | da | Danish |
es | Spanish | fi | Finnish |
pt | Portuguese | pl | Polish |
id | Indonesian | cs | Czech |
it | Italian | fil | Filipino |
ko | Korean | fa | Persian |
ru | Russian | el | Greek |
th | Thai | hu | Hungarian |
vi | Vietnamese | mk | Macedonian |
ja | Japanese | ro | Romanian |
Note:
The
language parameter must use one of the codes listed above (e.g., zh, en). It must match the language specified in engine_model_type. For a full list of supported languages per engine, refer to the integration documentation.Recognition Performance
TRTC Proprietary ASR delivers ≥96% character accuracy for both Chinese and English, with first packet latency around 400ms on open-source test sets:
Test Set | Language / Scenario | Character Accuracy |
aishell | Mandarin Chinese | ≥96% |
test_meeting | Chinese Meeting | ≥96% |
test_net | Chinese Network Audio | ≥96% |
librispeech_clean | English (Clean Readings) | ≥96% |
librispeech_other | English (Other Accents/Noise) | ≥96% |
Domain-Specific Hotwords
Built-in domain-specific hotwords cover areas such as map POIs, entertainment, healthcare, AI technology, automotive, gaming, retail, and more, significantly improving recognition of proper nouns.
Third-Party ASR Integration
To use a third-party ASR provider, set
Provider to the vendor identifier and pass vendor-specific parameters (authentication, model, language, etc.) in the Params field. Parameter requirements are defined by the vendor documentation.Supported fields are:
Field Name | Description |
language | Language |
subscription_key | API key, obtained from your account |
endpoint | Endpoint URL, obtained from your account |
profanity_mode | Profanity filtering: supports none/masked/removed/raw |
endpoint_id | Custom model endpoint ID (for custom speech models). If empty, uses the default model |
{"STTConfig": {"Provider": "azure","Params": "{\"provider\":\"azure\",\"language\":\"zh-CN\",\"subscription_key\":\"p7o9fD7xEIszb***BLf6\", \"endpoint\": \"https://southeastasia.api.cognitive.microsoft.com\"}"}}
Configuration Example
To use TRTC Proprietary ASR, set the configuration as follows (recommended: use
bigmodel):{"STTConfig": {"Provider": "trtc","Params": "{\"engine_model_type\":\"bigmodel\",\"language\":\"zh\",\"vad_silence_time\":1000}"}}
Notes
1. ASR configuration does not support hot updates: Once a task is created, you cannot modify
STTConfig using the task modification API. To change the recognition engine or parameters, end the task and create a new one.2. Only required in Cascade mode: In S2S mode, speech understanding is handled by the end-to-end model, and
STTConfig is not required.3. How to access recognition results:
Server-side: When a sentence is recognized, the ASR result callback returns the final text for that sentence (including start/end timestamps and Turn ID). For details, see AI Conversation Callback Events.
Client-side: Retrieve recognized text in real time via SDK subtitle events. For details, see Client Real-Time Subtitles.
