Skip to content

Can we customize the microphone timeout for web speech api #137

Open

Description

@janaki112

In Android even if we set continuous flag to true, web speech api onend is called after a pause . This is working correctly in IOS . Can you please tell us a way where can customize the timeout being onend called?

Thanks.

Activity

  1. nicovalencia commented on May 10, 2025

    @nicovalencia

    I'm seeing Chrome throw a no-speech error if nothing is detected in 10 seconds. I don't see anything in the spec to set this timeout though, and if you want to keep it open for longer and try to restart the recognition instance on a no-speech catch, it errors because it's already been started.

    I'm also seeing on iOS, it stays open and will not throw a no-speech error.

    The use case here is to have an open mic for talking with an assistant. I would like it to stay open, even when an assistant is responding so the user can interrupt or respond to subsequent questions, and if it's automatically erroring after 10s, this cannot work.

    Maybe there is another approach I'm missing?

    Edit: I noticed this only happens the first time the recognition instance is started without detecting anything. The workaround I have right now is to catch the no-speech error, teardown the existing recognition instance and any handlers, then build a new one and start it. For some reason, the second one doesn't seem to be throwing any errors if you leave it open (just like how Safari handles it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions