I am trying to implement and test this code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0">
<meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>
<title>Tizen Web IDE - Tizen - Tizen basic Application</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="js/main.js"></script>
<script src="js/annyang.min.js"></script>
<script>
window.onload = function(){
/* if (annyang) {
var commands = {
'Good': function() {
alert('Hi! I can hear you.');
}
};
annyang.addCommands(commands);
annyang.start();
}*/
if (annyang) {
console.log("Enter");
// Let's define a command.
var commands = {
'ok watch': function() { alert("My alert"); }
};
annyang.debug();
// Add our commands to annyang
annyang.addCommands(commands);
// Start listening.
annyang.start();
}
else {
alert("Error alert");
}
}
</script>
</head>
<body>
</body>
</html>
The problem is that this code works fine with the Tizen web simulator, but in the Tizen emulator I got this error ("My alert").
What's wrong? Thanks in advance.
SpeechRecognition needed by annyang is not implemented. According to documentation Web Speech is implemented only partially (API Reference > W3C/HTML5 API Reference > Media section):