本文介绍了iOS13 OnDevice 语音识别(支持OnDeviceRecognition 标志)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使 iOS 13 OnDevice 语音识别正常工作.但是,验证 supportsOnDeviceRecognition 标志(这是启用 OnDevice 识别的初步步骤)始终返回 false.我正在使用 iPad 6th Gen 和 iOS 13.3.我在其他设备上测试了 supportsOnDeviceRecognition 标志,发现它仅适用于某些设备.

I'm trying to get the iOS 13 OnDevice Speech recognition working. However validating the supportsOnDeviceRecognition flag, which is the preliminary step to enable OnDevice recognition, always returns false. I'm using iPad 6th Gen with iOS 13.3. I tested supportsOnDeviceRecognition flag with other devices and see it works only for some.

private var speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "en_US"))
.
.
.
if #available(iOS 13, *) {
    if speechRecognizer?.supportsOnDeviceRecognition ?? false {
        recognitionRequest.requiresOnDeviceRecognition = true
    }
}

根据以下说明,在每次读取之间延迟几秒钟后,我尝试多次读取 supportsOnDeviceRecognition,但没有帮助.

I tried reading supportsOnDeviceRecognition multiple times after few seconds delay between each read per the below note, but it doesn't help.

根据 iOS 13 发行说明:

supportsOnDeviceRecognition 属性在第一次访问时总是返回 false.几秒钟后,再次访问它会返回正确的值.

The supportsOnDeviceRecognition property always returns false the first time it’s accessed. After a few seconds, accessing it again returns the correct value.

有没有人遇到过类似的问题以及如何解决这个问题?

Has anyone encountered similar problem and how to go about this?

推荐答案

我得到了 supportsOnDeviceRecognition 的标志,最终返回 true.我必须去设置> Siri &搜索 > Siri Voice.. 我注意到美国人(我想要的)被选中,它开始下载方言.下载完成后,重启设备,标志变为真.

I got the flag supportsOnDeviceRecognition finally returning true. I have to go to Settings > Siri & Search > Siri Voice.. I noticed the American (the one I want) was selected and it started downloading the dialect. After the download is complete, restarted the device and the flag became true.

这篇关于iOS13 OnDevice 语音识别(支持OnDeviceRecognition 标志)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 07:43