本文介绍了我的annyang程序出错了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现这个annyang程序:

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?

推荐答案

SpeechRecognition 无法在Firefox(桌面版29)中使用,请参阅:

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 需要像Google Chrome这样的浏览器

SpeechRecognition requires browsers like "Google Chrome"

这篇关于我的annyang程序出错了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 23:39