Ok I was able to resolve my confusion with SFSpeechRecognizer. What I found was:
SFSpeechRecognizer no longer works in simulator on iOS 17 at all. It works fine on iOS 16.4 simulator but in 17.0 it returns error 1107 and a nil transcript in the completion block of recognitionTask(with:resultHandler). This is regardless of whether requiresOnDeviceRecognition is set true or false.
SFSpeechRecognizer works fine on device in iOS 17, but emits spurious error 1101 messages in the console during the recognition process. These logs don't seem to negatively affect performance or the resulting transcript. Again, this is regardless of whether requiresOnDeviceRecognition is set true or false.
I think that the limitation of only working on-device is known by Apple ... the sample app described in https://developer.apple.com/documentation/speech/recognizing_speech_in_live_audio mentions this caveat: "The sample app doesn’t run in Simulator, so you need to run it on a physical device with iOS 17 or later, or iPadOS 17 or later." This is a little vague, but does add weight to the idea that simulator usage is not supported.
Post
Replies
Boosts
Views
Activity
Nope I'm wrong. Still a problem on iOS 17.0 simulator and devices up to and including iOS 17.0.3. Doesn't seem to be a problem on iPhone 14 Pro simulator running iOS 16.4.
I was seeing a similar issue with Xcode 15.0 and the iPhone 15 Pro simulator on iOS 17.0. Speech recognition worked once after a Erase all Content and Settings, but then emitted 1101 error messages to console even after rebooting the simulator. I never saw the 1107 error.
For me the solution was to not even instantiate the SFSpeechRecognizer until after calling SFSpeechRecog nizer.requestAuthorization(). I had been instantiating the object, asking for permission, then starting to call additional API and apparently I wasn't asking for permission early enough.