user1444393
user1444393

Reputation: 233

Error with my annyang program

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

Answers (2)

muberra_d
muberra_d

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

Korvo
Korvo

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:

fixed footer

SpeechRecognition requires browsers like "Google Chrome"

Upvotes: 3

Related Questions