SFSpeechRecognizer.isAvailable returns wrong values

As of iOS 17 SFSpeechRecognizer.isAvailable returns true, even when recognition tasks cannot be fulfilled and immediately fail with error “Siri and Dictation are disabled”. The same speech recognition code works as expected in iOS 16. In iOS 16, neither Siri or Dictation needed to be enabled to have SpeechRecognition to be available and it works as expected. In the past, once permissions given, only an active network connection is required to have functional SpeechRecognition. There seems to be 2 issues in play:

  1. In iOS 17, SFSpeechRecognizer.isAvailable incorrectly returns true, when it can’t fulfil requests.
  2. In iOS 17 dictation or Siri being enabled is required to handle SpeechRecognition tasks, while in iOS 17 this isn’t the case.

If issue 2. Is expected behaviour (I surely hope not), there is no way to actually query if Siri or dictation is enabled to properly handle those cases in code and inform the user why speech recognition doesn’t work.

Expected behaviour: Speech recognition is available when Siri and dictation is disabled SFSpeechRecognizer.isAvailable returns correctly false when no SpeechRecognition requests can be handled.

iOS Version 17.0 (21A329) Xcode Version 15.0 (15A240d)

Anyone else experiencing the same issues or have a solution? Reported this to Apple as well -> FB13235751

Replies

Further experimentation yields the following findings. When the iOS device is set to English (US), both SFSpeechRecognizer.isAvailable and .supportsOnDeviceRecognition return true. If we then set the SFSpeechAudioBufferRecognitionRequest’s requiresOnDeviceRecognition to true, we observe the stated issue where speechrecognition tasks fail with “Siri and Dictation are disabled” errors, while according to the SFSpeechRecognizer, it should work.

  • For anyone coming across this: this seems to be fixed on iOS 17 but is still a problem on MacOS Sonoma 14.4.x and the proposed work-around by @GeertB functions on MacOS (thanks to him for sharing).

Add a Comment