简体   繁体   English

设备上的语音识别是一回事吗?

[英]is on-device speech recognition a thing?

New in iOS 13, you're supposed to be able to say this ( import Speech ): iOS 13 中的新功能,您应该可以这样说( import Speech ):

let req = SFSpeechAudioBufferRecognitionRequest()
let loc = Locale(identifier: "en-US")
guard let rec = SFSpeechRecognizer(locale:loc)
    else {print("no recognizer"); return}
print("rec isAvailable says: \(rec.isAvailable)")
if rec.supportsOnDeviceRecognition {
    print("on device recognition")
    req.requiresOnDeviceRecognition = true
} else {
    print("no on device recognition")
}

The trouble is that I get "no on device recognition" on all my devices.问题是我在我的所有设备上都得到"no on device recognition" I can do speech recognition just fine;我可以很好地进行语音识别; I just can't do on-device speech recognition.我只是无法进行设备上的语音识别。 Is this feature real, or is it merely aspirational on Apple's part?这个功能是真实的,还是仅仅是苹果公司的愿望?

It's likely you're running into a known issue with supportsOnDeviceRecognition on 13.1.您可能在 13.1 上遇到了supportsOnDeviceRecognition的已知问题。 From the iOS/iPadOS 13.1 Release Notes :iOS/iPadOS 13.1 发行说明

The supportsOnDeviceRecognition property always returns false the first time it's accessed. supportsOnDeviceRecognition属性在第一次被访问时总是返回 false。 After a few seconds, accessing it again returns the correct value.几秒钟后,再次访问它会返回正确的值。 (47822242) (47822242)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM