Failure of speech recognition when "supportsOnDeviceRecognition" is set to "True".

I am using SFSpeechRecognizer to perform speech recognition, but I am getting the following error.

[SpeechFramework] -[SFSpeechRecognitionTask localSpeechRecognitionClient:speechRecordingDidFail:]_block_invoke Ignoring subsequent local speech recording error: Error Domain=kAFAssistantErrorDomain Code=1101 "(null)"

Setting requiresOnDeviceRecognition to False works correctly, but previously it worked with True with no error.

The value of supportsOnDeviceRecognition was True, so the device is recognizing that it supports speech recognition. iPad Pro 11inch iOS 16.5.

Is this expected behavior?

I have the same problem, no matter the value for requiresOnDeviceRecognition. Also, it is a kind of random. Sometimes I have the error logs, sometimes it works well.

The error Code=1101 often has to do with incorrect/incomplete setup off offline dictation on your device.

If you set request.requiresOnDeviceRecognition = true the recognition process uses Apple’s dictation service.

The dictation service only works offline if

  1. you have the keyboard installed for the same language + region you want the dictation / speech recognition for
  2. you have Enable Dictation toggled On and
  3. the Dictation Language for the lang + region you want has been downloaded by the system.

If the above conditions are not met, you will see the 1101 error.

Example:

If you want offline dictation for „de-DE“ (german language for region Germany) you need to have such a keyboard installed. In the device's Setting / General / Keyboard / Keyboards … be sure to have the one keyboard installed for your lang + region speech recognition (in our example „German (Germany)“). Further down in General / Keyboard turn on Enable Dictation. If Dictation is enabled, you see a further entry below called Dictation Languages. Open it to make sure the dictation languages are downloaded (you see a note about the status there).

Once the dictation language(s) are downloaded, speech recognition with request.requiresOnDeviceRecognition = true should work for that language/region.

Failure of speech recognition when "supportsOnDeviceRecognition" is set to "True".
 
 
Q