0

I am aware that you can only request access to the browser's microphone in google chrome (and other browser's as far as I know) with either https or http. I have a node server and am using Annyang which works fine when I am connected to wifi as usual (requests access to microphone, does its thing after the user accepts).

My problem is that my application is meant to be used with a drone which means that I will be connected to the drone's wifi (which doesn't connect to the internet). I didn't think this would be a problem because I downloaded the annyang.min.js file and I don't need any internet connection for any other parts of my app. However, whenever I connect to the drone and fire up the server it will repeatedly ask for permission to use the microphone no matter how many times I press accept (unless I click deny at which point the app obviously stops working). The server is still using http and the page isn't continually reloading or anything (which would cause it to ask again) as far as I know. I don't have any other tabs open that are trying to use the microphone.

Is there any reason why this problem might be occurring and what would be the best way to fix it? I have a hunch that the problem is caused by the lack of internet connection but I can't find any information on why that would cause a problem. Has anybody experienced this issue (or a similar one before) and if so how did you fix it?

TL;DR:

my speech recognition code works when I am not connected to the drone's wifi and stops working after I connect to it.

All the code can be found on github. Let me know if I can clarify anything.

4

1 回答 1

0

The speech recognition library you use, is actually using Google Chrome's integration of the Web Speech API.

Based on this article from 2014 (and from different tests I made) you have to be connected to the internet in order to use Google's speech recognition :

Web Speech Recognition, as implemented here by Google, is a Hybrid solution in that it involves Client sidecode, built into browser, which captures the input audio and Server side code at Google which performs the actual speech recognition and returns the results.
The Web Speech API Specification is, at least in principle, a Browser API but here we see it communicating with a remote server with proprietary software owned by Google.

So maybe when it will be implemented by others than google, you'll be able to use it while not connected. As a workaround, maybe you can try to follow this thread, where it seems they're able to connect the drone to a router (might be possible to keep internet connection then).

于 2015-01-09T18:08:43.253 回答