Reputation: 233
I am trying to implements this annyang program:
<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/1.1.0/annyang.min.js"></script>
<script>
if (annyang) {
// Let's define our first command. First the text we expect, and then the function it should call
var commands = {
'show tps report': function() {
$('#tpsreport').animate({bottom: '-100px'});
}
};
// Add our commands to annyang
annyang.addCommands(commands);
// Start listening. You can call this here, or attach this call to an event, button, etc.
annyang.start();
}
else{
alert("Error alert");
}
</script>
The problem is that I got "Error alert" message, and I didn't figure out the reason?
Upvotes: 0
Views: 1664
Reputation: 1
You should edit annyang library your layout url.
<script src="https://cdnjs.cloudflare.com/ajax/libs/annyang/2.6.1/annyang.min.js"></script>
Upvotes: 0
Reputation: 9754
SpeechRecognition
not work in Firefox (Desktop version 29), see:
(function () {
var b = this;
console.log(b.SpeechRecognition); // undefined
console.log(b.webkitSpeechRecognition); // undefined
console.log(b.mozSpeechRecognition); // undefined
console.log(b.msSpeechRecognition); // undefined
console.log(b.oSpeechRecognition); // undefined
}).call(this);
See in https://www.talater.com/annyang/ (Fixed footer), shows:
SpeechRecognition
requires browsers like "Google Chrome"
Upvotes: 3