Web Speech API Custom Words

点点圈 提交于 2019-12-04 03:11:08
Nikolay Shmyrev

When I speak my custom word normally, it thinks I'm saying something else (which makes sense).

Google provides very limited implementation of speech API without support for grammars, see the question about that:

Grammar in Google speech API

Morever, even the original specification is not complete in terms of grammars and their handling.

So what I want is to be able to say "Hey, foo" similar to how "Ok, Google" works. But my "foo" word is not an actual word so the SpeechRecognitionResult doesn't have my custom word.

This task is not a speech recognition task so it couldn't be solved effectively by a speech recognition engine, it requires keyword spotting because it need to filter all the speech except your keyword.

You could try to implement this using Pocketsphinx javascript library (http://cmusphinx.sourceforge.net/2013/06/voice-enable-your-website-with-cmusphinx/). With pocketsphinx, it's easier to debug pronunciation issues there too.

See also Web Speech API - SpeechGrammar which specifically describes support for grammars.

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