Is there a way to use a grammar with the HTML 5 speech input API?

夙愿已清 提交于 2019-11-27 05:08:01
Nikolay Shmyrev

In Google Chrome you can not use grammars yet, overall they decided to use free-form recognition only. Relevant question is Grammar in Google speech API.

Grammars are supported in Firefox Web Speech API, but the feature is experimental.

If your browser supports HTML5 audio, you might want to try to recognize words from your grammar using Pocketsphinx.js library, it provides javascript-based recognizer which should be very good for grammars.

I assume your a talking about the Speech Input API Specification as defined by the W3C. According to this specification grammars are supported, which is the method used by speech recognition systems to restrict possible inputs. Look for the section titled "Speech recognition grammars". The problem will be how well it is supported in the particular browser that is being used, which is the case for an HTML 5 specific function since it is not a completed standard yet. Chrome seems to be the most up to date with the standard. Checkout this blog post from the Chrome team on implementing the Speech Input API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!