如果 supportsOnDeviceRecognition 为真且离线模式可用,SFSpeechRecognizer 是否有限制?

Does SFSpeechRecognizer have a limit if supportsOnDeviceRecognition is true and offline mode is available?

根据 Apple 文档,SFSpeechRecognizer 可以发送的请求数量有限制。

Be prepared to handle failures caused by speech recognition limits. Because speech recognition is a network-based service, limits are enforced so that the service can remain freely available to all apps. Individual devices may be limited in the number of recognitions that can be performed per day, and each app may be throttled globally based on the number of requests it makes per day. If a recognition request fails quickly (within a second or two of starting), check to see if the recognition service became unavailable. If it is, you may want to ask users to try again later. https://developer.apple.com/documentation/speech/sfspeechrecognizer

另一个文档说一个设备每小时可以发送1000个请求。

The current rate limit for the number of SFSpeechRecognitionRequest calls a device can make is 1000 requests per hour. Please note this limit is on the number of requests that a device can make and is not tied to the application making it. This is regardless of the length of audio associated with the request. For a given SFSpeechRecognitionRequest, you are allowed up to one minute of audio per request.

现在我正在创建一个如下所示的 SFSpeechRecognizer 并检查 supportsOnDeviceRecognition 属性 指示语音识别器是否可以在没有网络访问的情况下运行。它 returns true 在我的 iOS 13.2.3 安装设备上。

let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "en-US"))!
print(speechRecognizer.supportsOnDeviceRecognition) //true

我已尝试 运行 我的应用程序离线,并且在没有互联网连接的情况下也能正常工作。但是如果 supportsOnDeviceRecognition 为真,是否还有请求限制没有信息。在这种情况下,即使设备已连接到互联网,SFSpeechRecognizer 也可能不会连接到 Apple 服务器,因为这是不必要的。只有supportsOnDeviceRecognition为真才限速吗?

根据 WWDC2019 上的演示文稿,On-device 没有限制。

https://developer.apple.com/videos/play/wwdc2019/256/