-1

我正在使用 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();
4

1 回答 1

0

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

于 2021-11-05T16:11:23.647 回答