有没有办法在HTML 5语音输入API中使用语法? [英] Is there a way to use a grammar with the HTML 5 speech input API?

查看:133
本文介绍了有没有办法在HTML 5语音输入API中使用语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HTML 5语音输入API,并且希望让服务器知道哪些答案可以从语音输入中返回。有没有办法设置可能的输入列表?

解决方案

在谷歌浏览器中你还不能使用语法,总的来说他们决定仅使用自由格式识别。相关问题是 Google语音API中的语法



Firefox Web Speech API 支持语法

如果您的浏览器支持HTML5音频,您可能需要尝试使用 Pocketsphinx.js 库,它提供了基于javascript的识别器,对于语法来说应该非常好。


I'm working with the HTML 5 speech input API and I want to let the server know which answers it can expect to be returned from the speech input. Is there a way to set a list of possible inputs?

解决方案

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.

这篇关于有没有办法在HTML 5语音输入API中使用语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆