Created
June 19, 2012 11:44
-
-
Save meru-akimbo/2953685 to your computer and use it in GitHub Desktop.
html5の音声認識を用いたspeaking test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>speech test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script> | |
function speechInput() { | |
var test = $("#get_voice").val(); | |
if(test.match(/my name is/)){ | |
alert("good! because include 'my name is'"); | |
}else{ | |
alert("bad! because not include 'my name is'"); | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<h1>What your name?</h1> | |
<input id="get_voice" type="text" x-webkit-speech onwebkitspeechchange="speechInput();" /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment