localhost から html/javascript アプリを実行しようとしました。このアプリは、Win7 PC の Chrome ブラウザで正常に動作する annyang 音声制御ツールを使用しています。
ウェブサイトへのコメント ( https://www.talater.com/annyang/ ) は次のようにアドバイスしています:-
localhost で実行したい場合は、「lokalhost/index.html」などのリンクを使用しないでください。http://127.0.0.1:58604/web/index.html のような IP を使用する と、Chromeからマイク。
http://127.0.0.1/myPage.htmlを試してみましたが、正常に読み込まれますが、Chrome はマイクの許可を求めたり、音声コマンドに応答したりしません。
http://127.0.0.1:58604/myPage.htmlを使用すると、「Web ページを利用できません」というエラーが発生します。
これを機能させる方法について誰か提案がありますか? (私はフェイスブックをやっていないので、ウェブサイトで話すことはできません)。
編集1
これが私のHTMLページからの関連コードです(元の縮小された annyang.min.js を美化しました)
<script src="myFiles/js/annyang.js"></script>
と
function F_Init_Voice_Commands() //... using Annyang
{
//... annyang object is created in the annyang.js module.
if ( annyang )
{
//... Let's define our first command. First the text we expect ('Hello'), and then the function it should call (alert())
var commands =
{
'Hello': function()
{
alert ("Hello there!");
}
};
//.. Add our commands to annyang object
annyang.addCommands(commands);
//... Start listening. You can call this here, or attach this call to an event, button, etc.
annyang.start();
}
} //... EOF F_Init_Voice_Commands().
編集2
URL: localhost/myFile.html または URL: 127.0.0.1/myFile.html を使用すると問題なく動作します。しかし、同時にマイク アクセスを使用している他のブラウザー タブがあってはならないようです。