iOS 中的语音识别何时受到限制,即 requestAuthorization returns `SFSpeechRecognizerAuthorizationStatusRestricted`

when is the speech recognition in iOS restricted i.e requestAuthorization returns `SFSpeechRecognizerAuthorizationStatusRestricted`

我正在制作一个将使用语音识别的应用程序,我想知道我的应用程序遇到这种情况的频率或时间

我知道这与限制语音识别的设备有关,而不是与用户有关,但具体是什么时候?? 是由于某些特定型号不支持语音识别还是 iOS 版本特定 或者是否有一些设置可以限制应用程序使用语音识别

虽然不再十分准确,但可以将限制视为家长控制,它阻止用户甚至可以选择启用由设备隐私设置控制的服务。

https://support.apple.com/en-ca/HT201304

这属于 "Here are the things you can restrict:"

Speech Recognition: Prevent apps from accessing Speech Recognition or Dictation

你多久会遇到一次?谁知道呢,但如果您的应用程序针对未成年人,那么这可能会增加机会,但这纯粹是推测性的。

回答你的另一个问题:

...is it due to some specific models not supporting speech recognition...

有一种不同的方法可以测试设备上的语音支持:

https://developer.apple.com/documentation/speech/sfspeechrecognizer/1649885-isavailable

使用isAvailable(对于Swift)或available(Obj-C),您可以判断语音识别器是否可用。

既然你把你的问题标记为 Objective-C,那么下面的方法就可以了:

SFSpeechRecognizer *recognizer = [[SFSpeechRecognizer alloc] init];
if (recognizer.available) {
    // Do recognizer things
}

同Swift:

let recognizer = SFSpeechRecognizer()
if recognizer.isAvailable { }