Speech Recognition FAQ

Updated at:

This topic answers frequently asked questions about speech recognition features, performance, recognition quality, SDKs, and billing.

Features and models

Which speech recognition models are available?

Models are available for 8 kHz and 16 kHz audio, with domain-specific models at each sample rate. View and select models in the project configuration in the Intelligent Speech Interaction console. Match the model to the sample rate, language, and use case of the input audio.

Which languages and dialects are supported?

For supported languages, dialects, and sample rates, see the model information in the short sentence recognition, real-time speech recognition, and recording file recognition API references.

For recording file recognition, the language and dialect tables in the recording file recognition API reference describe model support for punctuation, inverse text normalization (ITN), disfluency removal, semantic sentence segmentation, and audio-to-text alignment. The project configuration in the console shows the models currently available for a project.

Which languages are supported for telephone audio?

Telephone recordings typically use a sample rate of 8 kHz. When choosing a model, check the supported languages and dialects for 8 kHz in the API reference for short sentence recognition, real-time speech recognition, or recording file recognition.

Can a Chinese model recognize occasional English words and letters?

Yes. Mandarin Chinese models support audio that includes a small number of English words and letters. Choose a model based on the primary language and use case of the audio.

Can speech recognition run locally without a network connection?

The cloud speech recognition services described in this topic require audio to be sent to the server. They do not perform local offline recognition. In recording file recognition, “offline” refers to asynchronous transcription of an existing recording, not local processing.

Why are pauses not producing sentence breaks in real-time recognition?

Voice activity detection (VAD) uses silence in the audio to detect pauses. If the audio capture application stops sending data during silence, the server cannot use that silence to segment sentences. Continue sending the captured silent audio during pauses instead of stopping the stream.

Compare the audio timestamps in recognition results with the actual audio duration. If the server receives significantly less audio than expected, check whether the capture application filters out silence. When semantic sentence segmentation is enabled, the post-processing model also affects sentence boundaries.

Can speech recognition split audio into multiple sentences?

Real-time speech recognition can return results for multiple sentences in one task. Each short sentence recognition request corresponds to one sentence and does not split its result into multiple sentence results.

Why does ITN not convert every Chinese number to Arabic numerals?

The ITN model chooses number formats based on common written usage. It does not replace every Chinese number with Arabic numerals.

How does short sentence recognition determine commas and periods?

Punctuation is determined from the acoustic features of the audio and semantic analysis of the recognized text.

How does enable_sample_rate_adaptive differ from sample_rate in the flash version?

sample_rate specifies the input audio sample rate for the flash version and defaults to 16000. In recording file recognition, enable_sample_rate_adaptive enables automatic downsampling of audio above 16 kHz to 16 kHz. The parameters are not interchangeable. The flash version does not use this switch.

Can transcription distinguish a customer from a service agent?

Speaker diarization can distinguish speakers, but it does not identify their business roles as customers or service agents. Determine those roles from how the audio was captured or from business information. We recommend recording different roles on separate channels. For recording file recognition diarization settings, see auto_split, supervise_type, and speaker_num in the recording file recognition API reference.

How can I distinguish the left and right channels in recording file recognition?

Results for multichannel audio use channel IDs rather than explicit left and right labels. If the capture order is fixed, use the IDs to identify the channels. Recording file recognition 4.0 returns the ChannelId field. For the response structure, see the recording file recognition API reference.

Does real-time speech recognition return a channel ID?

No. Real-time speech recognition accepts mono audio. It does not use recording file recognition channel IDs to distinguish multiple channels.

Can one recognition request use multiple hotword lists?

A request can specify only one vocabulary_id and use one hotword list. If a hotword list does not meet the requirements, consider a custom language model. For hotword list management, see Use POP API to create business-specific hotwords.

How do recording file recognition versions 4.0 and 2.0 differ?

In version 2.0, callbacks and polling return different JSON fields and naming styles. Version 4.0 uses the same result structure and camel case naming for both methods. The current default value of version is 4.0. For parameters and historical differences, see the recording file recognition API reference.

Can I submit an audio file URL and receive a transcript?

Yes. Use recording file recognition to submit a server-accessible audio URL in file_link. Then poll for the result or receive a callback. For the complete procedure, see the recording file recognition API reference.

Can recording file recognition generate SRT subtitles?

The API does not return an SRT file. Generate subtitles from the recognized text and start and end times. Sentence information is provided in the Text, BeginTime, and EndTime fields in Sentences. For word-level timing, set version to 4.0 and enable enable_words, then read Word, BeginTime, and EndTime in Words. Time values are in milliseconds.

Which audio encodings are supported?

Supported encodings vary by service. For real-time speech recognition formats, sample rates, and channel requirements, see the real-time speech recognition API reference. Use an audio tool such as Audacity to inspect the actual encoding rather than relying only on the file extension.

Which sample rates are supported?

Real-time speech recognition typically uses 8000 Hz or 16000 Hz. Telephone customer service audio typically uses 8000 Hz, while mobile apps, PCs, and web applications typically use 16000 Hz. Convert audio captured at other sample rates to a supported rate, and match the request parameters and model configuration to that rate.

Recording file recognition also supports sample rates such as 32 kHz and 44 kHz. For requirements, see the recording file recognition API reference.

How can I check an audio file's sample rate?

Use Audacity or FFmpeg to inspect the audio file's sample rate.

How do the audio requirements for real-time and recording file recognition differ?

Real-time speech recognition uses mono, 16-bit audio at 8 kHz or 16 kHz. Recording file recognition supports mono and stereo audio, with different encoding and sample rate requirements. Check the real-time speech recognition API reference and the recording file recognition API reference separately.

Does EmotionValue represent an emotion category?

No. In recording file recognition results, EmotionValue represents emotional energy. It is calculated as the volume in decibels divided by 10 and ranges from 1 to 10. It does not represent sentiment categories such as positive or negative.

Performance and latency

How is recognition accuracy calculated?

Recognition quality is commonly measured by error rate: character error rate (CER) for Chinese and word error rate (WER) for English. Divide the sum of insertions, deletions, and substitutions by the total number of characters or words in the reference transcript. The following result is measured in words:

%WER  15.07  [  2165 /  14365,  74  ins,  385  del,  1706  sub  ]
%SER  67.75  [  645 /  952  ]
Scored  952  sentences,  0  not  present  in  hyp.

Using 1 - WER, the accuracy for this dataset is (14365 - 74 - 385 - 1706) / 14365 = 84.93%, or 100% - 15.07%.

What character recognition accuracy can the models achieve?

In speech recognition accuracy evaluations by the National Software Testing Center, a 1,207-character Mandarin sample was read at a constant rate of 240 characters per minute, with a headset microphone 1 cm from the mouth in a noise-reduced environment below 60 decibels. Recognition accuracy exceeded 98% in each of five rounds. This accuracy was certified by the National Software Testing Center.

Actual accuracy depends on headset quality, background noise, accents, and other factors. For 8 kHz, 16-bit PCM or WAV recordings with the customer and service agent on separate channels and a signal-to-noise ratio above 20 dB, 85% accuracy can be guaranteed in most commercial use cases.

What is the latency of recording file recognition in flash mode?

The flash version commits to recognizing 30 minutes of audio within 10 seconds after the server receives all audio data. Upload time is not included and depends on factors such as client bandwidth. The latency field in the response records server processing time.

Can an 8 kHz model recognize 16 kHz audio?

Not directly. The 8 kHz and 16 kHz models require audio at their respective sample rates. Select a matching model or resample the audio and update the request parameters accordingly.

Does the flash version limit request frequency?

The flash version limits concurrent requests rather than request frequency. View the concurrency quota in the console.

What is the recognition accuracy for Cantonese?

The 8 kHz and 16 kHz Cantonese models achieve approximately 80% to 95% accuracy, depending on the speech corpus and pronunciation. There may be a relative difference of about 5% in accuracy between services. Overall, recording file recognition performs better than short sentence recognition, which performs better than real-time speech recognition.

How long does a recording of about 15 seconds take to transcribe?

Recording file recognition is asynchronous. Tasks for free users complete within 24 hours, and tasks for paid users complete within 3 hours. These limits exclude large-scale submissions, defined as more than 500 hours of recordings uploaded within half an hour. For processing time conditions, see the recording file recognition API reference. For audio up to 60 seconds that requires a prompt response, we recommend short sentence recognition.

Can I change the priority of a recording file recognition task?

No. Task priorities cannot be changed to place an urgent task ahead of tasks that are being processed.

Which model is recommended for a telephone conversation?

We recommend the end-to-end Shiyinshi model. Match the audio sample rate to the model.

How much audio can one request recognize?

Short sentence recognition supports audio up to 60 seconds. Real-time speech recognition does not limit the total audio duration, but audio must be streamed and the task ended as required by the API.

How do streaming and non-streaming recognition differ?

Non-streaming recognition returns a result after a sentence ends. Streaming recognition can return multiple intermediate results during speech, followed by a final sentence result. Intermediate results can change. Update the intermediate text for each sentence with its final result.

What is ASR endpoint latency?

Endpoint latency is the time between the client finishing audio transmission and recognition completing. For short sentence recognition and real-time speech recognition, it is approximately 300 ms, depending on the model and audio.

The RESTful API for short sentence recognition receives audio in a batch, so processing time depends on audio duration. Excluding network overhead, processing time can be estimated at 0.2 times the audio duration. For example, one minute of audio takes approximately 12 seconds. Actual processing time varies with the model and server load.

How can I reduce real-time recognition latency?

Check whether enable_semantic_sentence_detection is set to true. Semantic sentence segmentation can improve recognition accuracy but adds a small amount of latency. If low latency is a priority, set this parameter to false.

Recognition quality and troubleshooting

How can I improve recognition of incorrectly recognized terms?

Start with methods that do not require labeled audio:

  1. Train a custom language model with business keywords, sentences, and passages. Include varied contexts for each keyword. For example, for the Chinese product name “银税e贷”, include phrases such as “银税e贷是什么” and “如何办理银税e贷”.

  2. For keywords that are still recognized incorrectly, strengthen training by adding relevant corpus entries or increasing model weights.

  3. Use hotwords for individual terms that remain problematic.

If accents or similar factors affect overall quality and these methods are insufficient, consider acoustic model optimization. This requires labeled audio. The transcripts can also be included in the language model's training corpus.

Why are isolated Chinese characters difficult to recognize?

An isolated character has a short pronunciation and no surrounding context, which makes recognition difficult. Adding a hotword may not improve the result. Consider a custom model.

Can I adjust hotword weights?

Person-name and place-name hotwords do not support weights. Business-specific hotwords do. The console does not support setting weights when creating business-specific hotwords, so use the API to adjust them. For details, see Use POP API to create business-specific hotwords.

How can I correct recording file recognition timestamps?

For models that support timestamp alignment, set enable_timestamp_alignment to true. For model support and parameter details, see the recording file recognition API reference.

What can I do if noise is recognized as text?

Adjust speech_noise_threshold, which ranges from -1 to 1. A lower value increases sensitivity but may cause more noise to be recognized as speech. A higher value may filter out valid speech. For example, increasing the value from 0.6 to 0.7 reduces sensitivity. If words are missed, lower it to a value such as 0.5, 0.2, or -0.2.

Java

transcriber.addCustomedParam("speech_noise_threshold", -0.1);

C++

request->setPayloadParam("speech_noise_threshold", -0.1);

How can I reduce missing words in far-field recognition?

Far-field and near-field audio require different VAD thresholds. Lower speech_noise_threshold to increase sensitivity, for example from -0.2 to -0.3 or -0.4. If more noise is recognized as speech, increase it to a value such as -0.1 or 0. The parameter ranges from -1 to 1.

What should I check when most recognition results are inaccurate?

First check that the actual audio, request parameters, and model configuration match. Online recognition uses 8 kHz, 16-bit or 16 kHz, 16-bit audio. Set the request sample rate to 8000 or 16000 accordingly, and select a model with the same sample rate.

For a public cloud deployment, check the model selected for the Appkey's project in the console. For a private cloud deployment, check the sample rate defined in service/resource/asr/default/models/readme.txt.

What can I do about persistent errors in a specific business term?

For example, if the Chinese product name “银税e贷” is repeatedly recognized incorrectly:

  • Add varied contexts, such as “银税e贷是什么” and “如何办理银税e贷”, to the custom language model corpus.

  • Configure “银税e贷” as a business-specific hotword and adjust its weight.

  • In a private cloud deployment, configure corrections in service/resource/asr/default/models/nn_itn/correct.list. The first column contains the incorrectly recognized text, such as “银税一袋”, and the second contains the correct text, such as “银税e贷”. Restart ASR for the change to take effect.

How can I improve punctuation and sentence segmentation?

VAD sentence segmentation is used by default. For models that support semantic sentence segmentation, set enable_semantic_sentence_detection to true. When using semantic sentence segmentation with real-time recognition, also enable enable_intermediate_result to return intermediate results.

Why does recording file recognition return duplicate text?

Check whether the recording has two channels with identical content. If so, set first_channel_only to true to recognize only the first channel.

How can I troubleshoot slow recognition or timeouts?

  1. Compare the SDK example with the application, and record logs and the request's task_id.

  2. Use tcpdump on Linux or Wireshark on Windows to check connections and audio transmission.

  3. Distinguish connection timeouts from timeouts caused by a lack of audio during recognition. For connection timeouts, check the network and client timeout settings. After the task starts, continue sending audio as required by the API.

Configure the connection timeout through the SDK's timeout settings. This does not change the server's no-audio timeout limit.

Why are only a few words sometimes recognized?

Check that the audio sample rate matches the model and that the input meets the service's mono audio requirement. Do not send stereo recordings directly to real-time speech recognition.

To process stereo recordings, use recording file recognition.

How can I improve accuracy after confirming that the configuration is correct?

Configure hotwords to improve recognition of business keywords, or use a custom language model for domain-specific text. For instructions, see Create hotwords in the console and Custom language model.

SDKs and task handling

Which protocol does the short sentence recognition SDK example use?

The SDK example uses WebSocket. The RESTful API uses HTTP and has a different interaction model.

Is a Python SDK available for real-time speech recognition?

Yes. The Python SDK provides NlsSpeechTranscriber to start recognition, send audio, and handle recognition results and task completion callbacks.

For installation and examples, see Python SDK for real-time speech recognition.

What does endtime=-1 mean in a recognition result?

In streaming response formats that use endtime, a value of -1 indicates that the sentence has not ended and the result is intermediate.

How can I switch between 8000 Hz and 16000 Hz in the HarmonyOS NEXT SDK?

The example records and recognizes audio at 16000 Hz by default. To switch to 8000 Hz, update both the recording and recognition settings:

  1. In AudioCapture.ets, replace samplingRate:audio.AudioSamplingRate.SAMPLE_RATE_16000 with samplingRate:audio.AudioSamplingRate.SAMPLE_RATE_8000.

  2. In the .ets file for the recognition example, add object.set("sample_rate", "8000") to genInitParams(). No other locations need to be changed.

How should I end and restart a real-time recognition task?

Stop sending audio, then call the SDK's stop method or send StopTranscription and wait for TranscriptionCompleted. Start a new task for the next recognition request. If the connection has closed, reconnect before starting the task.

If there is no valid speech, the task still completes but may not return a SentenceEnd event.

Billing

Does the flash version of recording file recognition offer a free trial?

No. It is a paid service with no free trial.