nodejs Webkit アプリに音声認識を実装するために数日間作業しましたが、うまくいきませんでした。
ローカルの html ファイル デモを作成しようとしましたが、うまくいきませんでした。そのため、Apache を使用してデモをホストに配置しましたが、それでもうまくいきませんでした。次に、https を使用してローカルホストに接続しようとしましたが、デモでは機能しました。問題は、nodejs webkit アプリを https 環境で実行する方法がわからないことです。
デモに annyang ライブラリを使用し、動作するはずのサイトから例をコピーしたことに注意してください。
助けてくれてありがとう:)
更新 1: edwan が正当に要求したように、ここに私の問題を示す基本的な簡単な例を示します。
<script. src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.0.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 = {
'hello': function() {
alert("you said hello");
}
};
// 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();
}
</script>
このコードを nodejs Webkit 環境に配置すると、機能しません。また、ローカルのクロム環境またはhttpを使用するホストでも。httpsでのみ機能しました