简体   繁体   English

仅Web语音API数字

[英]Web Speech API Digits only

I am writing a web application which requires me to recognize spoken digits. 我正在编写一个Web应用程序,要求我识别语音数字。 I am using the javascript Web Speech API. 我正在使用javascript Web语音API。 It is working quite well at the moment, but I'd love to restrict the recognition to digits only, to improve the accuracy. 目前,它的运行情况还不错,但我希望将识别范围仅限于数字,以提高准确性。 One thought I've had is to set the grammar, but I cannot for the life of me work out how. 我曾经想到的是设定语法,但是我无法为自己的生活制定出方法。 Is anybody aware of a way to make this restriction? 有人知道进行此限制的方法吗?

Speech Grammar could be a way to do this but it is not yet supported by any browser. 语音语法可能是实现此目的的一种方法,但尚无任何浏览器支持。 http://www.w3.org/TR/speech-grammar/ .For the time being you have to use a javaScript function like isDigits() http://www.w3.org/TR/speech-grammar/ 。目前,您必须使用像isDigits()这样的javaScript函数

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

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