Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
830 views
in Technique[技术] by (71.8m points)

swift - Is there a way to use iOS speech recognition in offline mode?

I want to know if there's a way to use iOS speech recognition in offline mode. According to the documentation (https://developer.apple.com/reference/speech) I didn't see anything about it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I am afraid that there is no way to do it (however, please make sure to check the update at the end of the answer).

As mentioned at the Speech Framework Official Documentation:

Best Practices for a Great User Experience:

Be prepared to handle the failures that can be caused by reaching 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.


As an end user perspective, trying to get Siri's help without connecting to a network should displays a screen similar to:

enter image description here

Also, When trying to send a massage -for example-, you'll notice that the mike button should be disabled if the device is unconnected to a network.

enter image description here

Natively, the iOS itself won't able this feature until checking network connection, I assume that would be the same for the third-party developer when using the Speech Framework.


UPDATE:

After watching Speech Recognition API Session (especially, the part 03:00 - 03:25) , I came up with:

Speech Recognition API usually requires an internet connection, but there are some of new devices do support this feature all the time; You might want to check whether the given language is available or not.

Adapted from SFSpeech?Recognizer Documentation:

Note that a supported speech recognizer is not the same as an available speech recognizer; for example, the recognizers for some locales may require an Internet connection. You can use the supported?Locales() method to get a list of supported locales and the is?Available property to find out if the recognizer for a specific locale is available.


Further Reading:

These topics might be related:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...