目录

class info
com.huawei.hms.mlsdk.asr.MLAsrConstants
Constants of the ASR service.

Constant Summary

TypeNameDesc
StringACTION_HMS_ASR_SPEECHAction name of Intent created when the recognizer is started.
intERR_NO_NETWORKNetwork error.
intERR_NO_UNDERSTANDSpeech unrecognized.
intERR_SERVICE_UNAVAILABLEService unavailable.
StringFEATUREFeature. Currently, the real-time result output and whole-section result output after recognition are supported.
intFEATURE_ALLINONEAfter the speech is complete, the recognition result is returned at a time.
intFEATURE_WORDFLUXThe recognition result is returned along with the speech.
StringLANGUAGELanguage used by the speaker.
StringLAN_EN_USEnglish (US).
StringLAN_FR_FRFrench.
StringLAN_ZHMandarin Chinese (Simplified Chinese). The value is the same as that of LAN_ZH_CN.
StringLAN_ZH_CNMandarin Chinese (Simplified Chinese).
intSTATE_LISTENINGStatus code in the onState callback, indicating that the recorder is ready.
intSTATE_NO_NETWORKStatus code in the onState callback, indicating that no network is available in the current environment.
intSTATE_NO_SOUNDStatus code in the onState callback, indicating that no speech is detected within 3s.
intSTATE_NO_SOUND_TIMES_EXCEEDStatus code in the onState callback, indicating that no result is detected within 6s.
intSTATE_NO_UNDERSTANDStatus code in the onState callback, indicating that the current frame fails to be detected on the cloud.
intSTATE_WAITINGStatus code in the onState callback, indicating that data is sent for the first time on a weak network.

Constants

Constant
public static final String ACTION_HMS_ASR_SPEECH
Action name used for creating the Intent parameter in startRecognizing.
Constant value: RECOGNIZE_SPEECH
Constant
public static final int ERR_NO_NETWORK
Network error.
Constant value: 11202
Constant
public static final intERR_NO_UNDERSTAND 
Speech unrecognized.
Constant value: 11204
Constant
public static final int ERR_SERVICE_UNAVAILABLE
Service unavailable.
Constant value: 11203
Constant
public static final String FEATURE
Recognition mode key carried by Intent in the startRecognizing API. Currently, the real-time result output and whole-section result output after recognition are supported.

FEATURE_WORDFLUX: The recognition result is returned in real time.

FEATURE_ALLINONE: The recognition result is returned after recognition is complete.

Constant value: FEATURE

Constant
public static final int FEATURE_ALLINONE
After the speech is complete, the recognition result is returned at a time.
Constant value: 12
Constant
public static final int FEATURE_WORDFLUX
The recognition result is returned along with the speech.
Constant value: 11
Constant
public static final String LANGUAGE
Language key carried by Intent in the startRecognizing API.

LAN_ZH/LAN_ZH_CN: Mandarin Chinese

LAN_EN_US: English (default)

LAN_FR_FR: French

Constant value: LANGUAGE

Constant
public static final String LAN_EN_US
English (US).
Constant value: en-US
Constant
public static final String LAN_FR_FR
French.
Constant value: fr-FR
Constant
public static final String LAN_ZH
Mandarin Chinese (Simplified Chinese). The value is the same as that of LAN_ZH_CN.
Constant value: zh
Constant
public static final String LAN_ZH_CN
Mandarin Chinese (Simplified Chinese).
Constant value: zh-CN
Constant
public static final int STATE_LISTENING
Status code in the onState callback, indicating that the recorder is ready.
Constant value: 1
Constant
public static final int STATE_NO_NETWORK
Status code in the onState callback, indicating that no network is available in the current environment.
Constant value: 7
Constant
public static final int STATE_NO_SOUND
Status code in the onState callback, indicating that no speech is detected within 3s.
Constant value: 2
Constant
public static final int STATE_NO_SOUND_TIMES_EXCEED
Status code in the onState callback, indicating that no result is detected within 6s.
Constant value: 3
Constant
public static final int STATE_NO_UNDERSTAND
Status code in the onState callback, indicating that the current frame fails to be detected on the cloud.
Constant value: 6
Constant
public static final int STATE_WAITING
Status code in the onState callback, indicating that data is sent for the first time on a weak network.
Constant value: 9