Ton*_*Nam 5 html5 automation google-chrome
Google Chrome在其浏览器中具有非常好的语音识别控制功能.例如,如果我放置此html标记:
<input id="speech" type="text" speech="speech" x-webkit-speech="x-webkit-speech" onspeechchange="processspeech();" onwebkitspeechchange="processspeech();" />
Run Code Online (Sandbox Code Playgroud)
用它的相应的javascript:
<script type="text/javascript">
function processspeech() {
var speechtext = $("#speech").val();
alert(speechtext);
}
</script>
Run Code Online (Sandbox Code Playgroud)
那么我将能够使用谷歌的语音识别.我想知道是否可以发送一个点击该输入控件,以便用JavaScript激活它.换句话说,我想通过点击小麦克风以外的按钮开始录制消息.我计划在本地使用该网站,所以也许我可以通过其他方式发送一个点击.
我设法用一个名为 autoit 的程序来做到这一点。步骤如下:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
function processspeech() {
var speechtext = document.getElementById("speech").value;
alert(speechtext);
}
</script>
</head>
<body>
<div id="speechinput">
<input id="speech" type="text" speech="speech" x-webkit-speech="x-webkit-speech" onspeechchange="processspeech();" onwebkitspeechchange="processspeech();" />
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
autoit window info
启动它”的程序,然后单击“摘要”选项卡我忘记强调ControlClick Coords
你将需要......
归档时间: |
|
查看次数: |
3485 次 |
最近记录: |