Google chrome has a very nice speech recognition control in it’s browser. For example if I place this html tag:
<input id="speech" type="text" speech="speech" x-webkit-speech="x-webkit-speech" onspeechchange="processspeech();" onwebkitspeechchange="processspeech();" />
with it’s corresponding javascript:
<script type="text/javascript">
function processspeech() {
var speechtext = $("#speech").val();
alert(speechtext);
}
</script>
then I will be able to use google’s speech recognition. I am wondering if it is possible to send a click to that input control in order to activate it with JavaScript. In other words I want to start recording the message by clicking my button other than the little microphone. I plan to use the website locally so maybe I can send a click some other way.
I manage to do it with a program called autoit. here are the steps:
1) download AutoIt and install.
2) Create the html:
3) Open the html file that was just created on the last step with google chrome
4) when you instal autoit there is a program called
autoit window infolaunch it and click in the summary tab5) drag the finder tool to google’s chrome window (specifically to the microphone).
6) create a new autoit script:
I forgot to highligh the
ControlClick Coordsyou will need that…7) type the following function in autoit with the results that you got from step 5:
8) Run the script by pressing {f5} and a click should then be sent to that control even if the window is hidden! you can then use ajax to send the result to your web server etc…