GithubHelp home page GithubHelp logo

Restart the listener. about speech_to_text HOT 6 CLOSED

csdcorp avatar csdcorp commented on August 14, 2024
Restart the listener.

from speech_to_text.

Comments (6)

sowens-csd avatar sowens-csd commented on August 14, 2024

Depending on the type of error you should be able to call listen again immediately and that will start a new listen session. There are some limits imposed by the provider on how long / frequently you can invoke speech recognition for. If recognition sessions were getting throttled by the provider, or if network connection problems were interfering, then calling listen would not work. Android, at least on Samsung devices, seems particularly aggressive about shutting down recognition.

Let me know if invoking listen again works for you.

from speech_to_text.

saisantosh2095 avatar saisantosh2095 commented on August 14, 2024

Tried calling the listen in the status callback. When ever the status changes to not listening was calling a new session on speech. This was working fine but after some time it throws the following error
{"errorMsg":"error_busy","permanent":true}
How should i restart the listener in case of this ?
And there is a parameter durationFor in the listen method, though i was giving it a value of 10 minutes just after being idle for few seconds it throws the error no match found and the listener stops listening. So what's the actual use case of that durationFor parameter ?

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

I'm guessing that the error_busy means that there is already a recognition session active. In your error handler try calling await speechToText.stop() before you call listen. It should resolve that error.

The duration parameter allows you to set a maximum listen duration that is separate from any OS defined timeout. The timeout that you are seeing is from the underlying OS. On iOS the speech recognition doesn't time out quickly, as it does on Android, so being able to stop a session automatically is useful.

from speech_to_text.

saisantosh2095 avatar saisantosh2095 commented on August 14, 2024

Will try to add that in error handler and check it .

from speech_to_text.

sowens-csd avatar sowens-csd commented on August 14, 2024

I'll assume the last suggestion resolved the issue and close this.

from speech_to_text.

rajvaya avatar rajvaya commented on August 14, 2024

Will try to add that in error handler and check it .

can you share your code please that restart the listener

from speech_to_text.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.