-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pause() and resume() not working #48
Comments
Same problem we are having... Sonus won't can't be stopped or pause and always hits the 60 second Google cloud audio streaming request limit |
Guessing this has to do with the Google Cloud Speech GA (they changed their endpointer types). I should be able to look at this tomorrow. |
After stopping Sonus recording stops using But when I want to start the recording by calling Sonus.start(sonus); and triggering hotword events.js:160 Error: write after end Kindly let me know the best way to start the recording for next utterance from the user after stopping the recording after calling Sonus.stop() |
I believe I found the error... You need to change I am away from keyboard on mobile so can't do a pull request. We ran into similar issues elsewhere for example Google changed speechContext to speechContexts and sampleRate to sampleRateHerz... |
@sharmmoh1983 I found in a Google Forums thread that @evancohen specifically created pause and resume as alternatives to stopping and starting as that produces the error you noted. https://groups.google.com/a/kitt.ai/forum/#!topic/snowboy-discussion/9ebzZiHC6po To test whether Sonus.pause("nameOfInstance") and Sonus.resume("nameOfInstance") are working... enable the verbose flag in index.js on Sonus.start("nameOfInstance"), pause it, and then see if it continues recording.
This is the code I am using to try to pause the mic when a final result comes in, then resume it again afterwards. Honestly without pause() and resume() working Sonus is useless in our application because we can only issue one command that inevitably runs over the 60 seconds of audio allowed by Google and you will get a GRPC Deadline Error. |
I'm not really sure how Sonus.pause() and Sonus.resume() are even working:
https://github.com/gillesdemey/node-record-lpcm16 I don't see anything about "pause" or "resume" in this library.... I'm probably going to try to use this library |
@16alexanders Check out my comment from the other day for the correct usage: #47 (comment) As for |
@evancohen |
@16alexanders END_OF_SINGLE_UTTERANCE -> END_OF_UTTERANCE |
@sharmmoh1983 you can make the change in index.js for Sonus but it didnt fix the issue. Like you, I can stop Sonus using Sonus.stop() but I can't restart it. @evancohen in its current form it's impossible to give Sonus more than one command. If I don't stop Sonus in the @evancohen I'm confused as to how anyone is using Sonus successfully in their projects because of this issue? This is my code... very short and simple |
If I use |
This is my code... very short and simple @16alexanders |
@sharmmoh1983 you shouldn't be using stop on line 45 because once that is called you can't call .start again. I think there's an issue with the deprecation of the v1beta google speech API. I'll be looking at it tonight. |
@sharmmoh1983 try to be constructive and read the information I'm posting instead of just searching for code that works... Maybe you could help look into this. If you follow the thread I already said that it wasn't working. Hopefully @evancohen can take a look and help us fix this issue so both of our projects can be up and running. :) |
@16alexanders : I have some code which is kind of doing what is required, but does not seem to be the right approach so i have done some constructive work ,it was just out of curiosity searching for working code ...my bad for missing your point in the thread |
Got a fix in the works here: gillesdemey/node-record-lpcm16#38 |
Thanks @evancohen for your support ...it is working now |
@evancohen Works good... the only issue I'm having is that I still end up eventually exceeding the maximum allowed stream duration.
Should I be doing this differently? |
@evancohen Nevermind... I ended up doing a workaround... in the error handler I simply restart Sonus with Sonus.start(sonus) after it complains about exceeding the max length of audio stream. |
You shouldn't be getting errors about max audio length after this change: Can you confirm that you have this line? |
Closing this issue because this is no longer a problem |
As reported in #47 (comment). I'll investigate ASAP.
The text was updated successfully, but these errors were encountered: