Friday, April 5, 2013
Do you want to accept inputs via voice? here is what you need to do.
working on Google Chrome browser
Put the following javascript in the head section of your html.
//adding speach recognition to an html text box
//Start of speech
<script type="text/javascript">
function voiceInputOver(val){
alert("Voice input is complete");
alert("Your input is " + val);
}
</script>
and put the following line of code in the body section
<input onwebkitspeechchange="voiceInputOver(this.value)" x-webkit-speech />
//end of speech
Here is sample working code
<html>
<head>
<script type="text/javascript">
function voiceInputOver(val){
alert("Voice input is complete");
alert("Your input is " + val);
}
</script>
</head>
<body>
<input onwebkitspeechchange="voiceInputOver(this.value)" x-webkit-speech />
</body>
</html>
working on Google Chrome browser
Put the following javascript in the head section of your html.
//adding speach recognition to an html text box
//Start of speech
<script type="text/javascript">
function voiceInputOver(val){
alert("Voice input is complete");
alert("Your input is " + val);
}
</script>
and put the following line of code in the body section
<input onwebkitspeechchange="voiceInputOver(this.value)" x-webkit-speech />
//end of speech
Here is sample working code
<html>
<head>
<script type="text/javascript">
function voiceInputOver(val){
alert("Voice input is complete");
alert("Your input is " + val);
}
</script>
</head>
<body>
<input onwebkitspeechchange="voiceInputOver(this.value)" x-webkit-speech />
</body>
</html>