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