Skip to content

Cannot have multiple speech-to-text listeners #115

@ceyxasm

Description

@ceyxasm

I have integrated S2T functionality in my application and it works at a URL X.
However when I open URL X in one more tab, my app runs into an endless loop of .onend()

    recognition.onend = () => {
      console.log("Speech recognition ended. Restarting recognition...");
      isRecognitionRunningRef.current = false; // Set running flag to false when recognition ends
      startRecognition(); // Restarting the recognition when speech ends
      // By using the startRecognition() function here, we can ensure that the funcion is started only when the existing instance has stopped.
    };

image
However as soon as I close the duplicate tab; it starts working as usual.
I just wanted to know an explanation for this behaviour but could not find anything in the docs.
All I found was: https://stackoverflow.com/questions/38261404/detect-if-another-browser-tab-is-using-speechrecognition

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