Closed shekit closed 7 years ago
Hi @shekit; thanks for reporting this. My understanding was that the Speech API does close the connection after some time, so this might be intended behavior. I will attempt to find out.
For what it is worth, I do think there is a pretty good case to be made for closing the connection after a few minutes of inactivity. After all, consider the case where we do not close a connection and someone inadvertently leaves one open and then gets a huge bill from us.
Hey @lukesneeringer, thanks for the response! I don't think that is the issue though. When I don't close the stream, google automatically sends me an error message around the 60 sec mark saying the maximum permissible limit is 65 seconds and closes the connection, which makes sense as it is indicated as the permissible streaming content limit in the docs.
So I began to explicitly close the google stream connection by causing .end() on it and I no longer receive that error around the 60 sec mark. However it does silently close(with no error) if I open another new connection and make a request after 4 mins.
If on the other hand, I continue making requests, as long as they are made within that 4 min mark, even if it is at 3 mins 50 seconds then I can keep it running forever.
@shekit Sorry for the delay in our investigation. Thank you for your patience. Since this issue got a bit stale, I wondered if you're still having problems or have found any solutions? I will dive in and follow the reproduction steps above, I just want to be sure you're still having these issues.
Environment details
Steps to reproduce
npm install -g electron@1.6.2
npm install --save nan
HOME=~/.electron-gyp npm install
in project folderkeyfile.json
in project folderelectron main.js
(from project folder)The Issue
close
event from the google detector and it doesn't transcribe anything. If I trigger it again, it transcribes successfully.close
event after a short period of inactivity which I have found to be consistently ~4 minutes, but no error is triggered.mic.unpipe(googlestream)
andgooglestream.end()
after I receive the final transcribed results. single_utterance is set to true.Any idea why this would be happening? This does not seem to be a timeout error as I am listening for error events emitted by the google stream and no errors are being emitted.
Thanks!