Skip to content

Failed to execute 'start' on 'SpeechRecognition': recognition has already started. at listen  #23

Description

@kushal-g

The above error is coming when stopping and again listening to the microphone in useSpeechRecognition hook and there is the callback for result is not getting executed. I'm getting it even when using the examples provided in the docs. I'm on Microsoft Edge Version 81.0.416.64

Activity

  1. MikeyParton commented on Apr 29, 2020

    @MikeyParton
    Owner

    I can reproduce the error and will take a closer look later today. It looks like support for SpeechRecognition on edge is pretty new and others have reported buggy behaviour even on Edge Canary 84.0.488.0. https://techcommunity.microsoft.com/t5/discussions/web-speech-api-support/m-p/1104645

  2. MikeyParton commented on Apr 30, 2020

    @MikeyParton
    Owner

    Unfortunately this appears to be a bug with Edge's implementation of the SpeechRecognition api. The following minimal example without react-speech-kit throws the same error.

    const recognition = new window.webkitSpeechRecognition();
    recognition.onstart = () => { console.log('started'); }
    recognition.onend = () => { console.log('ended'); }
    recognition.onresult = (e) => { console.log('result', e); }
    
    recognition.start();
    // 'started' is logged but onresult is not triggered as you speak
    
    recognition.stop();
    // 'ended' is not logged indicating that recognition hasn't been stopped properly
    
    recognition.start();
    // Uncaught DOMException: Failed to execute 'start' on 'SpeechRecognition': recognition has already started.
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions