SFSpeechRecognitionTask.error 错误码对照表

iOS 语音识别引擎中常见错误对照表 加注释了

error

An error object that specifies the error that occurred during a speech recognition task.

iOS 10.0+ macOS 10.15+ Mac Catalyst 13.1+ 

Declaration 

@property(nonatomic, readonly, copy, nullable) NSError *error;

Discussion

The system may return one of the errors listed in the table below.

Error Code

Error Domain

Description

102

kLSRErrorDomain

Assets are not installed. // Assets 未安装

201

kLSRErrorDomain

Siri or Dictation is disabled. // Siri or Dictation 被禁用

300

kLSRErrorDomain

Failed to initialize recognizer. // 初始化失败

301

kLSRErrorDomain

Request was canceled. // 请求取消 -常见

203

kAFAssistantErrorDomain

Failure occurred during speech recognition. // 语音识别失败

1100

kAFAssistantErrorDomain

Trying to start recognition while an earlier instance is still active. // 尝试识别, 但是之前的未结束. (没触发过)

1101

kAFAssistantErrorDomain

Connection to speech process was invalidated. // 连接无效

1107

kAFAssistantErrorDomain

Connection to speech process was interrupted. // 连接被中断 -长出现在App进入后台

1110

kAFAssistantErrorDomain

Failed to recognize any speech. // 无法识别语音 -常见

1700

kAFAssistantErrorDomain

Request is not authorized. // 设置了需要开权限

这些也会返回 :

Error Domain=NSURLErrorDomain Code=-1017  cannot parse response.

Error Domain=NSURLErrorDomain Code=-1001  The request timed out.

你可能感兴趣的:(iOS-功能,ios,语音识别,引擎,NSError)