html5语音

之前看到有些网站提供了语音搜索的功能,出于好奇就到网上查了一下,原来是html5的一个属性,只支持webkit内核的浏览器。
测试了一下,对中文和英文的识别的准确率还是挺高的。

[代码][HTML]代码

view source
print?
1 只需要将x-webkit-speech属性放到input框中即可,例如:
2 <inputtype="text"class="text"name="key"id="key"x-webkit-speech>
3 还有一些其他的参数,例如语言种类限制:
4 <inputtype="text"class="text"name="key"id="key"x-webkit-speech lang="zh-CN">