【问题标题】:Uncaught TypeError: SpeechKITT.displayRecognizedSentence is not a function未捕获的类型错误:SpeechKITT.displayRecognizedSentence 不是函数
【发布时间】:2021-12-19 16:08:55
【问题描述】:

我正在使用 annyang.js 进行语音识别,但我的 SpeechKITT.displayRecognizedSentence 不工作我尝试通过在本地文件夹中下载 annyang 库但对我没有任何作用请任何人帮助我 我的完整代码

var commands = {
  'hello': function() { alert('Hello world!'); }
};

// Add our commands to annyang
annyang.addCommands(commands);

// Tell KITT to use annyang
SpeechKITT.annyang();

// Stylesheet for KITT to use
SpeechKITT.setStylesheet('https://cdnjs.cloudflare.com/ajax/libs/SpeechKITT/1.0.0/themes/flat.css');

SpeechKITT.setInstructionsText('Some commands to try…');

SpeechKITT.setSampleCommands(['say Hello, Ok google etc..']);

SpeechKITT.displayRecognizedSentence(true);

// When start
SpeechKITT.setStartCommand(function() {
  console.info('Speech Recognition Started ______________________________');
  annyang.start();
});

// When abort
SpeechKITT.setAbortCommand(function() {
  console.info('Stopping ............................');
  annyang.abort();
});

// Render KITT's interface
SpeechKITT.vroom();

【问题讨论】:

    标签: javascript typeerror speech-recognition voice-recognition annyang


    【解决方案1】:

    看起来像图书馆问题,github上有关于那个的旧问题(https://github.com/TalAter/SpeechKITT/issues/42)

    【讨论】:

    • 感谢您的回复,但我看到了一些使用 annyang 的项目,并且在那里完美运行示例:github.com/patrickjquinn/P-Brain.ai
    • 安阳有什么好的替代品吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-19
    • 1970-01-01
    • 2019-06-06
    • 2019-05-24
    • 2021-12-15
    • 2019-10-26
    • 2016-06-27
    相关资源
    最近更新 更多